Fix for militia transported to NOWHERE during autoresolve in a different than current sector

INS for overhead map is back!
Weapon CTH at extreme range now calculated with soldier's real sight max


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1237 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Overhaul
2007-08-21 07:51:09 +00:00
parent f4bbb51e07
commit c01ba3f6f1
5 changed files with 13 additions and 7 deletions
+5 -3
View File
@@ -3649,7 +3649,8 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, UINT16 sGridNo, UINT8 ubAimTime
iChance -= iPenalty;
}
sDistVis = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, 0, pSoldier );
// 0verhaul: Changed to take expanded range from shooting at different levels into account
sDistVis = DistanceVisible( pSoldier, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, pSoldier->bTargetLevel, pSoldier );
// give some leeway to allow people to spot for each other...
// use distance limitation for LOS routine of 2 x maximum distance EVER visible, so that we get accurate
@@ -3664,14 +3665,15 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, UINT16 sGridNo, UINT8 ubAimTime
ubTargetID = WhoIsThere2( sGridNo, pSoldier->bTargetLevel );
// best to use team knowledge as well, in case of spotting for someone else
// 0verhaul: Why not use the distance visible as the max for line of sight testing?
if (ubTargetID != NOBODY && pSoldier->bOppList[ubTargetID] == SEEN_CURRENTLY || gbPublicOpplist[pSoldier->bTeam][ubTargetID] == SEEN_CURRENTLY)
{
iSightRange = SoldierToBodyPartLineOfSightTest( pSoldier, sGridNo, pSoldier->bTargetLevel, pSoldier->bAimShotLocation, (UINT8) (MaxDistanceVisible() * 2), TRUE );
iSightRange = SoldierToBodyPartLineOfSightTest( pSoldier, sGridNo, pSoldier->bTargetLevel, pSoldier->bAimShotLocation, (UINT8) sDistVis /*(MaxDistanceVisible() * 2) */, TRUE );
}
if (iSightRange == -1) // didn't do a bodypart-based test
{
iSightRange = SoldierTo3DLocationLineOfSightTest( pSoldier, sGridNo, pSoldier->bTargetLevel, pSoldier->bTargetCubeLevel, (UINT8) (MaxDistanceVisible() * 2), TRUE );
iSightRange = SoldierTo3DLocationLineOfSightTest( pSoldier, sGridNo, pSoldier->bTargetLevel, pSoldier->bTargetCubeLevel, (UINT8) sDistVis /* (MaxDistanceVisible() * 2) */, TRUE );
}
iSightRange *= 2;