# HG changeset patch # User sheepluva # Date 1316125101 -7200 # Node ID f737843dd33100104c0b66e20b1c57bd84c87e48 # Parent f2cd4d15465ba60bdf2f9b00056015ef48c3427c TestRectForObstacle: areas outside map borders are not passable diff -r f2cd4d15465b -r f737843dd331 hedgewars/uCollisions.pas --- a/hedgewars/uCollisions.pas Thu Sep 15 23:08:17 2011 +0200 +++ b/hedgewars/uCollisions.pas Fri Sep 16 00:18:21 2011 +0200 @@ -373,6 +373,9 @@ y2 := y; end; +if (hasBorder and ((y1 < 0) or (x1 < 0) or (x2 > LAND_WIDTH))) then + exit(true); + for y := y1 to y2 do for x := x1 to x2 do if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0)