Fix a rare bug when crosshair stucks in up position
authorunc0rr
Thu, 10 Dec 2009 18:20:34 +0000
changeset 2660 04c03640a7b0
parent 2659 947fa21d5cd8
child 2661 9689c6ee9114
Fix a rare bug when crosshair stucks in up position
hedgewars/HHHandlers.inc
--- a/hedgewars/HHHandlers.inc	Wed Dec 09 17:35:42 2009 +0000
+++ b/hedgewars/HHHandlers.inc	Thu Dec 10 18:20:34 2009 +0000
@@ -470,7 +470,7 @@
 	and ((Gear^.State and (gstMoving or gstHHJumping)) = gstMoving) then da:= 2 else da:= 1;
 
 if (((Gear^.Message and gm_Precise) = 0) or ((GameTicks mod 5) = 1)) then
-	if ((Gear^.Message and gm_Up) <> 0) and (Gear^.Angle - da >= CurMinAngle) then dec(Gear^.Angle, da)
+	if ((Gear^.Message and gm_Up) <> 0) and (Gear^.Angle >= CurMinAngle + da) then dec(Gear^.Angle, da)
 	else
 	if ((Gear^.Message and gm_Down) <> 0) and (Gear^.Angle + da <= CurMaxAngle) then inc(Gear^.Angle, da)
 end;