From 9691b728db861f9628b8d8f6ffa34deefb9cd3e5 Mon Sep 17 00:00:00 2001 From: Flugente Date: Thu, 12 Dec 2013 21:20:01 +0000 Subject: [PATCH] - Fix: not checking for NOBODY - Fix: uninitialised variable git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6690 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 2 +- Tactical/SoldierTooltips.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index e3476f83..814083a1 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -5999,7 +5999,7 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1 return; } - INT16 poisondamage; + INT16 poisondamage = 0; if ( ubAttackerID != NOBODY ) poisondamage = (INT16) ( (sDamage * MercPtrs[ubAttackerID]->GetPoisonDamagePercentage()) / 100 ); diff --git a/Tactical/SoldierTooltips.cpp b/Tactical/SoldierTooltips.cpp index fc8eef31..722c5325 100644 --- a/Tactical/SoldierTooltips.cpp +++ b/Tactical/SoldierTooltips.cpp @@ -89,7 +89,7 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier ) GetMouseMapPos( &usSoldierGridNo ); // get the distance to enemy's tile from the selected merc - if ( gusSelectedSoldier != NOBODY ) + if ( gusSelectedSoldier != NOBODY && gusUIFullTargetID != NOBODY ) { //CHRISL: Changed the second parameter to use the same information as the 'F' hotkey uses. //iRangeToTarget = GetRangeInCellCoordsFromGridNoDiff( MercPtrs[ gusSelectedSoldier ]->sGridNo, sSoldierGridNo ) / 10;