Allow head of rope to attach to hogs/barrels/crates again. Rope still does not, to avoid the bug.
authornemo
Sun, 17 Apr 2011 11:57:46 -0400
changeset 5150 63ad8a648afd
parent 5148 73b3b4b8359c
child 5151 cbadb9fa52fc
Allow head of rope to attach to hogs/barrels/crates again. Rope still does not, to avoid the bug.
hedgewars/GSHandlers.inc
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/GSHandlers.inc	Sat Apr 16 23:21:15 2011 +0400
+++ b/hedgewars/GSHandlers.inc	Sun Apr 17 11:57:46 2011 -0400
@@ -1549,7 +1549,7 @@
         HHGear^.dY := HHGear^.dY * len;
         end;
 
-    haveCollision:= ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) and ((Land[hwRound(Gear^.Y), hwRound(Gear^.X)] and $FF00) <> 0);
+    haveCollision:= ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) and ((Land[hwRound(Gear^.Y), hwRound(Gear^.X)]) <> 0);
 
     if not haveCollision then
         begin
@@ -1564,13 +1564,13 @@
             Gear^.Y:= RopePoints.ar[0].Y;
             end;
 
-        CheckCollisionWithLand(Gear);
+        CheckCollision(Gear);
         // if we haven't found any collision yet then check the otheer side too
         if (Gear^.State and gstCollision) = 0 then
             begin
             Gear^.dX.isNegative:= not Gear^.dX.isNegative;
             Gear^.dY.isNegative:= not Gear^.dY.isNegative;
-            CheckCollisionWithLand(Gear);
+            CheckCollision(Gear);
             Gear^.dX.isNegative:= not Gear^.dX.isNegative;
             Gear^.dY.isNegative:= not Gear^.dY.isNegative;
             end;
@@ -1678,7 +1678,7 @@
             end;
         end;
 
-    CheckCollisionWithLand(Gear);
+    CheckCollision(Gear);
 
     if (Gear^.State and gstCollision) <> 0 then
         if Gear^.Elasticity < _10 then
--- a/hedgewars/uAIAmmoTests.pas	Sat Apr 16 23:21:15 2011 +0400
+++ b/hedgewars/uAIAmmoTests.pas	Sun Apr 17 11:57:46 2011 -0400
@@ -115,7 +115,7 @@
 implementation
 uses uAIMisc, uVariables, uUtils;
 
-function Metric(x1, y1, x2, y2: LongInt): LongInt;
+function Metric(x1, y1, x2, y2: LongInt): LongInt; inline;
 begin
 Metric:= abs(x1 - x2) + abs(y1 - y2)
 end;