fix dud mine explosion
authornemo
Tue, 21 May 2013 23:17:28 -0400
changeset 9043 f9d53af63f04
parent 9042 fcec7b7799a6
child 9044 8a829987d514
fix dud mine explosion
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Tue May 21 23:00:20 2013 -0400
+++ b/hedgewars/GSHandlers.inc	Tue May 21 23:17:28 2013 -0400
@@ -1424,6 +1424,7 @@
 var vg: PVisualGear;
     dxdy: hwFloat;
 begin
+    if Gear^.Health = 0 then dxdy:= hwAbs(Gear^.dX)+hwAbs(Gear^.dY);
     if (Gear^.State and gstMoving) <> 0 then
         begin
         DeleteCI(Gear);
@@ -1441,7 +1442,6 @@
         doStepFallingGear(Gear);
     if (Gear^.Health = 0) then
         begin
-        dxdy:= hwAbs(Gear^.dX)+hwAbs(Gear^.dY);
         if (dxdy > _0_4) and (Gear^.State and gstCollision <> 0) then
             inc(Gear^.Damage, hwRound(dxdy * _50));