From 467649c7a475952f5d5ad4d1394b85e32330dd9a Mon Sep 17 00:00:00 2001 From: Flugente Date: Fri, 6 Dec 2013 21:46:00 +0000 Subject: [PATCH] Fix: crash when soldier dies without an attacker git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6688 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 0f16a7d07..8eee63f4a 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -5988,7 +5988,9 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1 return; } - INT16 poisondamage = (INT16) ( (sDamage * MercPtrs[ubAttackerID]->GetPoisonDamagePercentage()) / 100 ); + INT16 poisondamage; + if ( ubAttackerID != NOBODY ) + poisondamage = (INT16) ( (sDamage * MercPtrs[ubAttackerID]->GetPoisonDamagePercentage()) / 100 ); // DEDUCT LIFE ubCombinedLoss = this->SoldierTakeDamage( ANIM_CROUCH, sDamage, poisondamage, sBreathLoss, ubReason, this->ubAttackerID, NOWHERE, FALSE, TRUE );