Fix: NCTH throws error if not firing at soldier

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6261 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-07-30 18:17:54 +00:00
parent 5742725c19
commit 8f5ac3a935
+8 -4
View File
@@ -12145,10 +12145,14 @@ FLOAT CalcNewChanceToHitBaseTargetBonus(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pTar
fBaseModifier += fTempPenalty;
}
// Target has high Agility or Experience and is therefore harder to hit
FLOAT fTempPenalty = (FLOAT)__max((pTarget->stats.bExpLevel*10), pTarget->stats.bAgility);
fBaseModifier += (fTempPenalty * gGameCTHConstants.BASE_AGILE_TARGET) / 100;
// Flugente: there needs to be a target...
if ( pTarget )
{
// Target has high Agility or Experience and is therefore harder to hit
FLOAT fTempPenalty = (FLOAT)__max((pTarget->stats.bExpLevel*10), pTarget->stats.bAgility);
fBaseModifier += (fTempPenalty * gGameCTHConstants.BASE_AGILE_TARGET) / 100;
}
// INVIS TARGET
if (fCantSeeTarget)