hedgewars/GSHandlers.inc
changeset 9043 f9d53af63f04
parent 9041 aefe46d64dd9
child 9045 6561c42399d3
--- 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));