hedgewars/uGearsHandlersMess.pas
changeset 10494 0eb97cf4c78e
parent 10490 b30b8d39d662
child 10508 1a91c1fcba0d
--- a/hedgewars/uGearsHandlersMess.pas	Wed Nov 12 22:47:43 2014 +0900
+++ b/hedgewars/uGearsHandlersMess.pas	Fri Nov 14 17:00:47 2014 +0300
@@ -281,7 +281,7 @@
 
 if cWaterLine > hwRound(Gear^.Y) + Gear^.Radius then
     begin
-    if leftX > hwRound(Gear^.X) - Gear^.Radius then
+    if LongInt(leftX) + Gear^.Radius > hwRound(Gear^.X) then
         Gear^.X := Gear^.X - cDrownSpeed
     else
         Gear^.X := Gear^.X + cDrownSpeed;
@@ -2671,7 +2671,7 @@
     HHGear: PGear;
     hedgehog: PHedgehog;
     State: Longword;
-    switchDir: LongInt;
+    switchDir: Longword;
 begin
     AllInactive := false;
 
@@ -2712,7 +2712,7 @@
         PlaySound(sndSwitchHog);
 
         repeat
-            CurrentTeam^.CurrHedgehog := (CurrentTeam^.CurrHedgehog + switchDir) mod (CurrentTeam^.HedgehogsNumber);
+            CurrentTeam^.CurrHedgehog := (CurrentTeam^.CurrHedgehog + switchDir) mod CurrentTeam^.HedgehogsNumber;
         until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and
               (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.Damage = 0) and
               (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Effects[heFrozen]=0);