move gstWait - should make detecting drowning easier for mikade
authornemo
Fri, 05 Aug 2011 14:13:06 -0400
changeset 5498 fac3c15707d2
parent 5494 5f55e9202122
child 5501 0ba2dca673e6
move gstWait - should make detecting drowning easier for mikade
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Thu Aug 04 19:52:27 2011 -0400
+++ b/hedgewars/uGears.pas	Fri Aug 05 14:13:06 2011 -0400
@@ -910,7 +910,7 @@
         begin
         dec(delay2);
 
-        if ((delay2 mod cInactDelay) = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then 
+        if ((delay2 mod cInactDelay) = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then
             CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State and not gstAttacked;
         if delay2 = 0 then
             begin
@@ -1587,7 +1587,6 @@
 begin
     gear^.dX := _0;
     gear^.dY := _0;
-    gear^.State := gstWait;
     gear^.Damage := 0;
     gear^.Health := gear^.Hedgehog^.InitialHealth;
     gear^.Hedgehog^.Effects[hePoisoned] := false;
@@ -1604,6 +1603,7 @@
     if gear <> nil then begin
         RenderHealth(gear^.Hedgehog^);
         ScriptCall('onGearResurrect', gear^.uid);
+        gear^.State := gstWait;
     end;
     RecountTeamHealth(tempTeam);
 end;