HedgehogDamaged calls CurrentHedgehog
authornemo
Mon, 08 Dec 2014 14:52:56 -0500
changeset 10641 802589828f99
parent 10640 efa069762cb2
child 10642 8fdfa2b77d83
HedgehogDamaged calls CurrentHedgehog
hedgewars/uGearsList.pas
--- a/hedgewars/uGearsList.pas	Mon Dec 08 17:43:27 2014 +0100
+++ b/hedgewars/uGearsList.pas	Mon Dec 08 14:52:56 2014 -0500
@@ -698,7 +698,7 @@
 
         // should be not CurrentHedgehog, but hedgehog of the last gear which caused damage to this hog
         // same stand for CheckHHDamage
-        if (Gear^.LastDamage <> nil) then
+        if (Gear^.LastDamage <> nil) and (CurrentHedgehog <> nil) then
             uStats.HedgehogDamaged(Gear, Gear^.LastDamage, 0, true)
         else if CurrentHedgehog <> nil then
             uStats.HedgehogDamaged(Gear, CurrentHedgehog, 0, true);