constrain angle, decrement turn time
authornemo
Thu, 14 May 2009 03:41:34 +0000
changeset 2052 1f67933cb620
parent 2051 949fe7df09b6
child 2053 9a8a4add3eff
constrain angle, decrement turn time
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Wed May 13 19:53:45 2009 +0000
+++ b/hedgewars/GSHandlers.inc	Thu May 14 03:41:34 2009 +0000
@@ -471,7 +471,7 @@
     begin
     cLaserSighting:= true;
     HHGear^.Message:= 0;
-    dec(HHGear^.Angle,32)
+    if(HHGear^.Angle - 32 >= 0) then dec(HHGear^.Angle,32)
     end;
 
 if (HHGear^.Message and gm_Attack) <> 0 then
@@ -484,9 +484,14 @@
     end
 else
     if (GameTicks mod 32) = 0 then
-        if (GameTicks mod 4096) < 2048 then inc(HHGear^.Angle)
-        else dec(HHGear^.Angle);
+        if (GameTicks mod 4096) < 2048 then 
+            begin
+            if(HHGear^.Angle + 1 <= cMaxAngle) then inc(HHGear^.Angle)
+            end
+        else
+            if(HHGear^.Angle - 1 >= 0) then dec(HHGear^.Angle);
 
+if (TurnTimeLeft > 0) then dec(TurnTimeLeft)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////