hedgewars/uGears.pas
changeset 3949 4c4c0a2507cc
parent 3946 41e06b74c991
child 3951 c9a63db3e603
--- a/hedgewars/uGears.pas	Sun Oct 10 22:32:01 2010 +0200
+++ b/hedgewars/uGears.pas	Sun Oct 10 16:51:40 2010 -0400
@@ -696,6 +696,7 @@
 
 procedure ProcessGears;
 const delay: LongWord = 0;
+      delay2: LongWord = 0;
     step: (stDelay, stChDmg, stSweep, stTurnReact,
             stAfterDelay, stChWin, stWater, stChWin2, stHealth,
             stSpawn, stNTurn) = stDelay;
@@ -841,6 +842,20 @@
                 end;
             step:= Low(step)
             end;
+    end
+else if ((GameFlags and gfInfAttack) <> 0) then
+    begin
+    if delay2 = 0 then
+        delay2:= cInactDelay 
+    else
+        dec(delay2);
+
+    if delay2 = 0 then
+        begin
+        if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State and not gstAttacked;
+        CheckNoDamage;
+        CheckForWin
+        end
     end;
 
 if TurnTimeLeft > 0 then