mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user