restore the delay between shots
authornemo
Sun, 10 Oct 2010 23:41:24 -0400
changeset 3957 25b0a62e08de
parent 3956 604f08c54a01
child 3958 c2ece733fd96
restore the delay between shots
hedgewars/HHHandlers.inc
hedgewars/uGears.pas
--- a/hedgewars/HHHandlers.inc	Sun Oct 10 22:18:38 2010 -0400
+++ b/hedgewars/HHHandlers.inc	Sun Oct 10 23:41:24 2010 -0400
@@ -326,7 +326,10 @@
             begin
             OnUsedAmmo(CurrentHedgehog^);
             if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) = 0) and ((GameFlags and gfInfAttack) = 0) then
+                begin
                 TurnTimeLeft:= Ammoz[CurAmmoType].TimeAfterTurn;
+                State:= State or gstAttacked
+                end;
             if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) <> 0 then ApplyAmmoChanges(CurrentHedgehog^);
             if (GameFlags and gfInfAttack) <> 0 then State:= State or gstAttacked
             end;
--- a/hedgewars/uGears.pas	Sun Oct 10 22:18:38 2010 -0400
+++ b/hedgewars/uGears.pas	Sun Oct 10 23:41:24 2010 -0400
@@ -848,15 +848,17 @@
     if delay2 = 0 then
         delay2:= cInactDelay * 4
     else
+        begin
         dec(delay2);
 
-    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
-        SweepDirty;
-        CheckNoDamage;
-        CheckForWin
+        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
+            SweepDirty;
+            CheckNoDamage;
+            CheckForWin
+            end
         end
     end;