From d913cf5ad818981912a42e8cbe5608521d70c810 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 10 Apr 2016 15:39:41 +0000 Subject: [PATCH] Fix: crash in autoresolve git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8149 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/LOS.cpp | 2 +- Tactical/Weapons.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tactical/LOS.cpp b/Tactical/LOS.cpp index aa0df30e..d724b58b 100644 --- a/Tactical/LOS.cpp +++ b/Tactical/LOS.cpp @@ -3086,7 +3086,7 @@ BOOLEAN BulletHitMerc( BULLET * pBullet, STRUCTURE * pStructure, BOOLEAN fIntend // adjust for bullet going through person iImpact -= CalcBodyImpactReduction( ubAmmoType, ubHitLocation ); // adjust for other side of armour! - iImpact -= TotalArmourProtection( pTarget, ubHitLocation, iImpact, ubAmmoType, pBullet->fFragment ); + iImpact -= TotalArmourProtection( pTarget, ubHitLocation, iImpact, ubAmmoType, (pBullet && pBullet->fFragment) ); if (iImpact > 0) { pBullet->iImpact = (INT8) iImpact; diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index ed266b03..cca5ce4a 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -9657,7 +9657,7 @@ INT32 BulletImpact( SOLDIERTYPE *pFirer, BULLET *pBullet, SOLDIERTYPE * pTarget, } else { - iTotalArmourProtection = TotalArmourProtection( pTarget, ubHitLocation, iOrigImpact, ubAmmoType, pBullet->fFragment ); + iTotalArmourProtection = TotalArmourProtection( pTarget, ubHitLocation, iOrigImpact, ubAmmoType, (pBullet && pBullet->fFragment) ); iImpact = iOrigImpact - iTotalArmourProtection; // sevenfm: store armour protection