Cake makes a step after turn. This fixes cake stucking in air
authorunc0rr
Sat, 10 Jan 2009 15:45:15 +0000
changeset 1635 cc5976f292f9
parent 1634 486a89f0e843
child 1636 e528696f2177
Cake makes a step after turn. This fixes cake stucking in air
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Sat Jan 10 15:36:28 2009 +0000
+++ b/hedgewars/GSHandlers.inc	Sat Jan 10 15:45:15 2009 +0000
@@ -1676,14 +1676,17 @@
 xxn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].x;
 yyn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].y;
 
-
 if (xx = 0) then
 	if TestCollisionYwithGear(Gear, yy) then
 		PrevAngle
 	else begin
 		Gear^.Tag:= 0;
 		Gear^.Y:= Gear^.Y + int2hwFloat(yy);
-		if not TestCollisionXwithGear(Gear, xxn) then NextAngle
+		if not TestCollisionXwithGear(Gear, xxn) then
+			begin
+			Gear^.X:= Gear^.X + int2hwFloat(xxn);
+			NextAngle
+			end;
 		end;
 
 if (yy = 0) then
@@ -1692,7 +1695,11 @@
 	else begin
 		Gear^.Tag:= 0;
 		Gear^.X:= Gear^.X + int2hwFloat(xx);
-		if not TestCollisionYwithGear(Gear, yyn) then NextAngle
+		if not TestCollisionYwithGear(Gear, yyn) then
+			begin
+			Gear^.Y:= Gear^.Y + int2hwFloat(yyn);
+			NextAngle
+			end;
 		end;
 
 if Gear^.Tag = 0 then