From b73a0a97201c910c279732973f32deef73a0a3d0 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 14 Oct 2012 10:07:08 +1300 Subject: [PATCH] fix off-by-one in new tile query --- OpenRA.Game/WorldUtils.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/WorldUtils.cs b/OpenRA.Game/WorldUtils.cs index c4aa3f06cc..8c5c90f72a 100755 --- a/OpenRA.Game/WorldUtils.cs +++ b/OpenRA.Game/WorldUtils.cs @@ -58,10 +58,10 @@ namespace OpenRA public static IEnumerable FindTilesInCircle(this World world, CPos a, int r) { - if (r > TilesByDistance.Length) + if (r >= TilesByDistance.Length) throw new InvalidOperationException("FindTilesInCircle supports queries for only <= {0}".F(MaxRange)); - for(var i = 0; i < r; i++) + for(var i = 0; i <= r; i++) { foreach(var offset in TilesByDistance[i]) {