Fix (by Sevenfm): height difference penalty calculation for cowering targets in OCTH was using wrong target

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8249 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2016-06-06 14:45:23 +00:00
parent 5307881cb7
commit 6e1676c94f
2 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -7768,9 +7768,9 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
if (pSoldier->pathing.bLevel == pTarget->pathing.bLevel && pSoldier->pathing.bLevel > 0)
sCoweringPenalty = 0; // No cowering penalties when both are on the roof!
else if (pSoldier->pathing.bLevel < pSoldier->pathing.bLevel && gAnimControl[ pTarget->usAnimState ].ubHeight == ANIM_PRONE)
else if (pSoldier->pathing.bLevel < pTarget->pathing.bLevel && gAnimControl[ pTarget->usAnimState ].ubHeight == ANIM_PRONE)
sCoweringPenalty *= 2; // Much harder to shoot at anyone cowering above you.
else if (pSoldier->pathing.bLevel > pSoldier->pathing.bLevel)
else if (pSoldier->pathing.bLevel > pTarget->pathing.bLevel)
sCoweringPenalty /= 2; // Much easier to shoot at cowerers below you.
iChance -= sCoweringPenalty;
}