Add a 2nd timer variable due to conflicts. This could perhaps use renaming
authornemo
Sun, 21 Mar 2010 03:51:53 +0000
changeset 3028 d17cf923d7c3
parent 3027 32890edaa483
child 3029 67483e87590c
Add a 2nd timer variable due to conflicts. This could perhaps use renaming
hedgewars/uAmmos.pas
hedgewars/uGears.pas
--- a/hedgewars/uAmmos.pas	Sun Mar 21 01:54:57 2010 +0000
+++ b/hedgewars/uAmmos.pas	Sun Mar 21 03:51:53 2010 +0000
@@ -287,7 +287,7 @@
 
 with Hedgehog do
     begin
-    Gear^.Timer:= 10;
+    Gear^.Timer2:= 10;
 
     if (Ammo^[CurSlot, CurAmmo].Count = 0) then
         SwitchToFirstLegalAmmo(Hedgehog);
--- a/hedgewars/uGears.pas	Sun Mar 21 01:54:57 2010 +0000
+++ b/hedgewars/uGears.pas	Sun Mar 21 03:51:53 2010 +0000
@@ -44,7 +44,7 @@
             Radius: LongInt;
             Angle, Power : Longword;
             DirAngle: real;
-            Timer : LongWord;
+            Timer, Timer2 : LongWord;
             Elasticity: hwFloat;
             Friction  : hwFloat;
             Message, MsgParam : Longword;
@@ -1181,13 +1181,13 @@
     else
     if ((Gear^.State and gstAttacked) = 0) then
         begin
-        if Gear^.Timer > 0 then
+        if Gear^.Timer2 > 0 then
             begin
             // There must be a tidier way to do this. Anyone?
             if aangle <= 90 then aangle:= aangle+360;
-            if Gear^.dX > _0 then aangle:= aangle-((aangle-240)*Gear^.Timer/10)
-            else aangle:= aangle+((240-aangle)*Gear^.Timer/10);
-            dec(Gear^.Timer)
+            if Gear^.dX > _0 then aangle:= aangle-((aangle-240)*Gear^.Timer2/10)
+            else aangle:= aangle+((240-aangle)*Gear^.Timer2/10);
+            dec(Gear^.Timer2)
             end;
         amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType;
         case amt of