- Improved Bugfix:

BUGZILLA #556: Fixed CTD if enemy bleeds to death at the end of a players turn

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4598 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2011-08-01 21:57:47 +00:00
parent f64fc4133c
commit 1a2c89eea1
+1 -3
View File
@@ -3348,13 +3348,11 @@ BOOLEAN HandleSoldierDeath( SOLDIERTYPE *pSoldier , BOOLEAN *pfMadeCorpse )
//////////////////////////////////////////////////////////////
// WANNE: This should fix crash that could occur if enemy bleeds to death
if ( pSoldier->ubAttackerID < 254 )
{
// IF this guy has an attacker and he's a good guy, play sound
if ( ubAttacker != NOBODY )
{
if ( MercPtrs[ pSoldier->ubAttackerID ]->bTeam == gbPlayerNum && gTacticalStatus.ubAttackBusyCount > 0 )
if ( MercPtrs[ pSoldier->ubAttackerID ] != NULL && MercPtrs[ pSoldier->ubAttackerID ]->bTeam == gbPlayerNum && gTacticalStatus.ubAttackBusyCount > 0 )
{
gTacticalStatus.fKilledEnemyOnAttack = TRUE;
gTacticalStatus.ubEnemyKilledOnAttack = pSoldier->ubID;