Prevent vgtFlake's rotation angle to grow too high in its absolute value
authorunc0rr
Sat, 06 Nov 2010 23:07:20 +0300
changeset 4152 07008cb354f9
parent 4151 08b95ec1bfdf
child 4153 6bd94e4c5d65
Prevent vgtFlake's rotation angle to grow too high in its absolute value
hedgewars/VGSHandlers.inc
--- a/hedgewars/VGSHandlers.inc	Sat Nov 06 20:38:59 2010 +0100
+++ b/hedgewars/VGSHandlers.inc	Sat Nov 06 23:07:20 2010 +0300
@@ -33,6 +33,12 @@
     X:= X + (cWindSpeedf * 200 + dX + tdX) * Steps;
     Y:= Y + (dY + tdY + cGravityf * vobFallSpeed) * Steps;
     Angle:= Angle + dAngle * Steps;
+    if Angle > 360 then
+        Angle:= Angle - 360
+    else
+        if Angle < - 360 then
+            Angle:= Angle + 360;
+    
   
     if (round(X) >= cLeftScreenBorder) and
        (round(X) <= cRightScreenBorder) and