diff --git a/OpenRA.Editor/BrushTool.cs b/OpenRA.Editor/BrushTool.cs index 220fdacb56..8ed2f609c3 100644 --- a/OpenRA.Editor/BrushTool.cs +++ b/OpenRA.Editor/BrushTool.cs @@ -75,9 +75,10 @@ namespace OpenRA.Editor Action maybeEnqueue = (x, y) => { - if (s.Map.IsInMap(x, y) && !touched[x, y]) + var c = new CPos(x, y); + if (s.Map.IsInMap(c) && !touched[x, y]) { - queue.Enqueue(new CPos(x, y)); + queue.Enqueue(c); touched[x, y] = true; } }; diff --git a/OpenRA.Mods.RA/Buildings/Util.cs b/OpenRA.Mods.RA/Buildings/Util.cs index aca297f34d..f8b81bf6c0 100644 --- a/OpenRA.Mods.RA/Buildings/Util.cs +++ b/OpenRA.Mods.RA/Buildings/Util.cs @@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA.Buildings var res = world.WorldActor.Trait(); return FootprintUtils.Tiles(world.Map.Rules, name, building, topLeft).All( - t => world.Map.IsInMap(t.X, t.Y) && res.GetResource(t) == null && + t => world.Map.IsInMap(t) && res.GetResource(t) == null && world.IsCellBuildable(t, building, toIgnore)); } diff --git a/OpenRA.Mods.RA/Crate.cs b/OpenRA.Mods.RA/Crate.cs index fa8cdd58a6..883a87367b 100644 --- a/OpenRA.Mods.RA/Crate.cs +++ b/OpenRA.Mods.RA/Crate.cs @@ -90,7 +90,7 @@ namespace OpenRA.Mods.RA public bool CanEnterCell(CPos cell, Actor ignoreActor, bool checkTransientActors) { - if (!self.World.Map.IsInMap(cell.X, cell.Y)) return false; + if (!self.World.Map.IsInMap(cell)) return false; var type = self.World.Map.GetTerrainInfo(cell).Type; if (!info.TerrainTypes.Contains(type)) diff --git a/OpenRA.Mods.RA/Husk.cs b/OpenRA.Mods.RA/Husk.cs index 1606c1c3f7..4827b494b9 100644 --- a/OpenRA.Mods.RA/Husk.cs +++ b/OpenRA.Mods.RA/Husk.cs @@ -54,7 +54,7 @@ namespace OpenRA.Mods.RA public IEnumerable> OccupiedCells() { yield return Pair.New(TopLeft, SubCell.FullCell); } public bool CanEnterCell(CPos cell, Actor ignoreActor, bool checkTransientActors) { - if (!self.World.Map.IsInMap(cell.X, cell.Y)) + if (!self.World.Map.IsInMap(cell)) return false; if (!info.AllowedTerrain.Contains(self.World.Map.GetTerrainInfo(cell).Type)) diff --git a/OpenRA.Mods.RA/Move/Mobile.cs b/OpenRA.Mods.RA/Move/Mobile.cs index 6ede32679a..4581b402f7 100755 --- a/OpenRA.Mods.RA/Move/Mobile.cs +++ b/OpenRA.Mods.RA/Move/Mobile.cs @@ -101,7 +101,7 @@ namespace OpenRA.Mods.RA.Move public int MovementCostForCell(World world, CPos cell) { - if (!world.Map.IsInMap(cell.X, cell.Y)) + if (!world.Map.IsInMap(cell)) return int.MaxValue; var index = world.Map.GetTerrainIndex(cell); diff --git a/OpenRA.Mods.RA/Move/PathSearch.cs b/OpenRA.Mods.RA/Move/PathSearch.cs index b453a00a26..3eafb2409f 100755 --- a/OpenRA.Mods.RA/Move/PathSearch.cs +++ b/OpenRA.Mods.RA/Move/PathSearch.cs @@ -124,7 +124,7 @@ namespace OpenRA.Mods.RA.Move var newHere = p.Location + d; // Is this direction flat-out unusable or already seen? - if (!world.Map.IsInMap(newHere.X, newHere.Y)) + if (!world.Map.IsInMap(newHere)) continue; if (cellInfo[newHere.X, newHere.Y].Seen) continue; @@ -191,7 +191,7 @@ namespace OpenRA.Mods.RA.Move public void AddInitialCell(CPos location) { - if (!world.Map.IsInMap(location.X, location.Y)) + if (!world.Map.IsInMap(location)) return; cellInfo[location.X, location.Y] = new CellInfo(0, location, false);