# HG changeset patch # User nemo # Date 1303055866 14400 # Node ID 63ad8a648afd3a9f9103d4689fe364708159cf08 # Parent 73b3b4b8359ca3c480674bd964cc2b300d8f3a43 Allow head of rope to attach to hogs/barrels/crates again. Rope still does not, to avoid the bug. diff -r 73b3b4b8359c -r 63ad8a648afd hedgewars/GSHandlers.inc --- 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 diff -r 73b3b4b8359c -r 63ad8a648afd hedgewars/uAIAmmoTests.pas --- 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;