From 5560f276ca8802a8bf7c45f4d33c34204fec2a4b Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 26 Jun 2014 21:45:55 +1200 Subject: [PATCH] Map: Rename IsInMap -> Contains. --- OpenRA.Editor/BrushTool.cs | 6 +++--- OpenRA.Editor/Form1.cs | 2 +- OpenRA.Game/GameRules/WeaponInfo.cs | 2 +- OpenRA.Game/Graphics/Minimap.cs | 2 +- OpenRA.Game/Map/Map.cs | 4 ++-- OpenRA.Game/Orders/GenericSelectTarget.cs | 4 ++-- OpenRA.Game/Traits/World/ActorMap.cs | 4 ++-- OpenRA.Game/Traits/World/ResourceLayer.cs | 2 +- OpenRA.Game/Traits/World/Shroud.cs | 4 ++-- OpenRA.Game/Widgets/ViewportControllerWidget.cs | 2 +- OpenRA.Mods.RA/Air/Aircraft.cs | 4 ++-- OpenRA.Mods.RA/Air/FlyTimed.cs | 2 +- OpenRA.Mods.RA/Attack/AttackBase.cs | 2 +- OpenRA.Mods.RA/BridgeLayer.cs | 4 ++-- OpenRA.Mods.RA/Buildings/BuildingInfluence.cs | 6 +++--- OpenRA.Mods.RA/Buildings/Util.cs | 4 ++-- OpenRA.Mods.RA/Combat.cs | 2 +- OpenRA.Mods.RA/Crate.cs | 2 +- OpenRA.Mods.RA/Effects/Missile.cs | 2 +- OpenRA.Mods.RA/Husk.cs | 2 +- OpenRA.Mods.RA/Minelayer.cs | 2 +- OpenRA.Mods.RA/Move/Mobile.cs | 4 ++-- OpenRA.Mods.RA/Move/PathSearch.cs | 4 ++-- OpenRA.Mods.RA/RallyPoint.cs | 2 +- OpenRA.Mods.RA/Render/RenderLandingCraft.cs | 2 +- OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs | 4 ++-- OpenRA.Mods.RA/World/DomainIndex.cs | 6 +++--- 27 files changed, 43 insertions(+), 43 deletions(-) diff --git a/OpenRA.Editor/BrushTool.cs b/OpenRA.Editor/BrushTool.cs index e33b60cc76..e41fe45171 100644 --- a/OpenRA.Editor/BrushTool.cs +++ b/OpenRA.Editor/BrushTool.cs @@ -38,7 +38,7 @@ namespace OpenRA.Editor for (var v = 0; v < template.Size.Y; v++) { var cell = pos + new CVec(u, v); - if (surface.Map.IsInMap(cell)) + if (surface.Map.Contains(cell)) { var z = u + v * template.Size.X; if (tile[z].Length > 0) @@ -75,7 +75,7 @@ namespace OpenRA.Editor Action maybeEnqueue = (x, y) => { var c = new CPos(x, y); - if (s.Map.IsInMap(c) && !touched[x, y]) + if (s.Map.Contains(c) && !touched[x, y]) { queue.Enqueue(c); touched[x, y] = true; @@ -112,7 +112,7 @@ namespace OpenRA.Editor for (;;) { var q = p + d; - if (!s.Map.IsInMap(q)) return p; + if (!s.Map.Contains(q)) return p; if (s.Map.MapTiles.Value[q].Type != replace.Type) return p; p = q; } diff --git a/OpenRA.Editor/Form1.cs b/OpenRA.Editor/Form1.cs index 959d2fc220..c108f0b690 100644 --- a/OpenRA.Editor/Form1.cs +++ b/OpenRA.Editor/Form1.cs @@ -657,7 +657,7 @@ namespace OpenRA.Editor { var cell = new CPos(x + u, y + v); - if (!surface1.Map.IsInMap(cell)) + if (!surface1.Map.Contains(cell)) continue; if (surface1.Map.MapResources.Value[cell].Type == resourceType) diff --git a/OpenRA.Game/GameRules/WeaponInfo.cs b/OpenRA.Game/GameRules/WeaponInfo.cs index b554a2271e..ef7bb5bbfc 100644 --- a/OpenRA.Game/GameRules/WeaponInfo.cs +++ b/OpenRA.Game/GameRules/WeaponInfo.cs @@ -180,7 +180,7 @@ namespace OpenRA.GameRules if (target.Type == TargetType.Terrain) { var cell = target.CenterPosition.ToCPos(); - if (!world.Map.IsInMap(cell)) + if (!world.Map.Contains(cell)) return false; var cellInfo = world.Map.GetTerrainInfo(cell); diff --git a/OpenRA.Game/Graphics/Minimap.cs b/OpenRA.Game/Graphics/Minimap.cs index b121ed9e07..c766273883 100644 --- a/OpenRA.Game/Graphics/Minimap.cs +++ b/OpenRA.Game/Graphics/Minimap.cs @@ -136,7 +136,7 @@ namespace OpenRA.Graphics var color = t.Trait.RadarSignatureColor(t.Actor); foreach (var cell in t.Trait.RadarSignatureCells(t.Actor)) - if (world.Map.IsInMap(cell)) + if (world.Map.Contains(cell)) *(c + ((cell.Y - world.Map.Bounds.Top) * bitmapData.Stride >> 2) + cell.X - world.Map.Bounds.Left) = color.ToArgb(); } } diff --git a/OpenRA.Game/Map/Map.cs b/OpenRA.Game/Map/Map.cs index 9c1e13bd4d..06f3b9019d 100644 --- a/OpenRA.Game/Map/Map.cs +++ b/OpenRA.Game/Map/Map.cs @@ -461,7 +461,7 @@ namespace OpenRA return dataStream.ToArray(); } - public bool IsInMap(CPos xy) { return Bounds.Contains(xy.X, xy.Y); } + public bool Contains(CPos xy) { return Bounds.Contains(xy.X, xy.Y); } public void Resize(int width, int height) // editor magic. { @@ -638,7 +638,7 @@ namespace OpenRA foreach (var offset in TilesByDistance[i]) { var t = offset + center; - if (IsInMap(t)) + if (Contains(t)) yield return t; } } diff --git a/OpenRA.Game/Orders/GenericSelectTarget.cs b/OpenRA.Game/Orders/GenericSelectTarget.cs index c1499d18d2..a6048754ca 100644 --- a/OpenRA.Game/Orders/GenericSelectTarget.cs +++ b/OpenRA.Game/Orders/GenericSelectTarget.cs @@ -55,7 +55,7 @@ namespace OpenRA.Orders IEnumerable OrderInner(World world, CPos xy, MouseInput mi) { - if (mi.Button == expectedButton && world.Map.IsInMap(xy)) + if (mi.Button == expectedButton && world.Map.Contains(xy)) { world.CancelInputMode(); foreach (var subject in subjects) @@ -66,6 +66,6 @@ namespace OpenRA.Orders public virtual void Tick(World world) { } public IEnumerable Render(WorldRenderer wr, World world) { yield break; } public void RenderAfterWorld(WorldRenderer wr, World world) { } - public string GetCursor(World world, CPos xy, MouseInput mi) { return world.Map.IsInMap(xy) ? cursor : "generic-blocked"; } + public string GetCursor(World world, CPos xy, MouseInput mi) { return world.Map.Contains(xy) ? cursor : "generic-blocked"; } } } diff --git a/OpenRA.Game/Traits/World/ActorMap.cs b/OpenRA.Game/Traits/World/ActorMap.cs index 1ecbf99094..fd28f527c2 100644 --- a/OpenRA.Game/Traits/World/ActorMap.cs +++ b/OpenRA.Game/Traits/World/ActorMap.cs @@ -71,7 +71,7 @@ namespace OpenRA.Traits public IEnumerable GetUnitsAt(CPos a) { - if (!map.IsInMap(a)) + if (!map.Contains(a)) yield break; for (var i = influence[a]; i != null; i = i.Next) @@ -81,7 +81,7 @@ namespace OpenRA.Traits public IEnumerable GetUnitsAt(CPos a, SubCell sub) { - if (!map.IsInMap(a)) + if (!map.Contains(a)) yield break; for (var i = influence[a]; i != null; i = i.Next) diff --git a/OpenRA.Game/Traits/World/ResourceLayer.cs b/OpenRA.Game/Traits/World/ResourceLayer.cs index 61fd9790c0..0f405e1931 100644 --- a/OpenRA.Game/Traits/World/ResourceLayer.cs +++ b/OpenRA.Game/Traits/World/ResourceLayer.cs @@ -130,7 +130,7 @@ namespace OpenRA.Traits public bool AllowResourceAt(ResourceType rt, CPos cell) { - if (!world.Map.IsInMap(cell)) + if (!world.Map.Contains(cell)) return false; if (!rt.Info.AllowedTerrainTypes.Contains(world.Map.GetTerrainInfo(cell).Type)) diff --git a/OpenRA.Game/Traits/World/Shroud.cs b/OpenRA.Game/Traits/World/Shroud.cs index 73c7afd13e..154dc66384 100644 --- a/OpenRA.Game/Traits/World/Shroud.cs +++ b/OpenRA.Game/Traits/World/Shroud.cs @@ -217,7 +217,7 @@ namespace OpenRA.Traits public bool IsExplored(CPos cell) { - if (!map.IsInMap(cell)) + if (!map.Contains(cell)) return false; if (Disabled || !self.World.LobbyInfo.GlobalSettings.Shroud) @@ -233,7 +233,7 @@ namespace OpenRA.Traits public bool IsVisible(CPos cell) { - if (!map.IsInMap(cell)) + if (!map.Contains(cell)) return false; if (Disabled || !self.World.LobbyInfo.GlobalSettings.Fog) diff --git a/OpenRA.Game/Widgets/ViewportControllerWidget.cs b/OpenRA.Game/Widgets/ViewportControllerWidget.cs index bdd1d213fd..bd5a5327ab 100644 --- a/OpenRA.Game/Widgets/ViewportControllerWidget.cs +++ b/OpenRA.Game/Widgets/ViewportControllerWidget.cs @@ -93,7 +93,7 @@ namespace OpenRA.Widgets { TooltipType = WorldTooltipType.None; var cell = worldRenderer.Position(worldRenderer.Viewport.ViewToWorldPx(Viewport.LastMousePos)).ToCPos(); - if (!world.Map.IsInMap(cell)) + if (!world.Map.Contains(cell)) return; if (world.ShroudObscures(cell)) diff --git a/OpenRA.Mods.RA/Air/Aircraft.cs b/OpenRA.Mods.RA/Air/Aircraft.cs index 5400e021c9..cd05962639 100755 --- a/OpenRA.Mods.RA/Air/Aircraft.cs +++ b/OpenRA.Mods.RA/Air/Aircraft.cs @@ -165,7 +165,7 @@ namespace OpenRA.Mods.RA.Air public bool CanLand(CPos cell) { - if (!self.World.Map.IsInMap(cell)) + if (!self.World.Map.Contains(cell)) return false; if (self.World.ActorMap.AnyUnitsAt(cell)) @@ -246,7 +246,7 @@ namespace OpenRA.Mods.RA.Air return false; IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue); - cursor = self.World.Map.IsInMap(target.CenterPosition.ToCPos()) ? "move" : "move-blocked"; + cursor = self.World.Map.Contains(target.CenterPosition.ToCPos()) ? "move" : "move-blocked"; return true; } diff --git a/OpenRA.Mods.RA/Air/FlyTimed.cs b/OpenRA.Mods.RA/Air/FlyTimed.cs index c99fdc47a6..a904281e49 100755 --- a/OpenRA.Mods.RA/Air/FlyTimed.cs +++ b/OpenRA.Mods.RA/Air/FlyTimed.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Air { public override Activity Tick(Actor self) { - if (IsCanceled || !self.World.Map.IsInMap(self.Location)) + if (IsCanceled || !self.World.Map.Contains(self.Location)) return NextActivity; var plane = self.Trait(); diff --git a/OpenRA.Mods.RA/Attack/AttackBase.cs b/OpenRA.Mods.RA/Attack/AttackBase.cs index d5ab7465b1..77fd5e0ff8 100644 --- a/OpenRA.Mods.RA/Attack/AttackBase.cs +++ b/OpenRA.Mods.RA/Attack/AttackBase.cs @@ -207,7 +207,7 @@ namespace OpenRA.Mods.RA bool CanTargetLocation(Actor self, CPos location, List actorsAtLocation, TargetModifiers modifiers, ref string cursor) { - if (!self.World.Map.IsInMap(location)) + if (!self.World.Map.Contains(location)) return false; IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue); diff --git a/OpenRA.Mods.RA/BridgeLayer.cs b/OpenRA.Mods.RA/BridgeLayer.cs index 06147c111d..62e3f1078e 100644 --- a/OpenRA.Mods.RA/BridgeLayer.cs +++ b/OpenRA.Mods.RA/BridgeLayer.cs @@ -95,7 +95,7 @@ namespace OpenRA.Mods.RA var subtile = new CPos(ni + ind % template.Size.X, nj + ind / template.Size.X); // This isn't the bridge you're looking for - if (!w.Map.IsInMap(subtile) || w.Map.MapTiles.Value[subtile].Type != tile || + if (!w.Map.Contains(subtile) || w.Map.MapTiles.Value[subtile].Type != tile || w.Map.MapTiles.Value[subtile].Index != ind) continue; @@ -109,7 +109,7 @@ namespace OpenRA.Mods.RA // Used to check for neighbouring bridges public Bridge GetBridge(CPos cell) { - if (!world.Map.IsInMap(cell)) + if (!world.Map.Contains(cell)) return null; return bridges[cell]; diff --git a/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs b/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs index 45b202d80a..8ccaf15509 100755 --- a/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs +++ b/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs @@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA.Buildings return; foreach (var u in FootprintUtils.Tiles(map.Rules, a.Info.Name, b.Info, a.Location)) - if (map.IsInMap(u) && influence[u] == null) + if (map.Contains(u) && influence[u] == null) influence[u] = a; }; @@ -46,14 +46,14 @@ namespace OpenRA.Mods.RA.Buildings return; foreach (var u in FootprintUtils.Tiles(map.Rules, a.Info.Name, b.Info, a.Location)) - if (map.IsInMap(u) && influence[u] == a) + if (map.Contains(u) && influence[u] == a) influence[u] = null; }; } public Actor GetBuildingAt(CPos cell) { - if (!map.IsInMap(cell)) + if (!map.Contains(cell)) return null; return influence[cell]; diff --git a/OpenRA.Mods.RA/Buildings/Util.cs b/OpenRA.Mods.RA/Buildings/Util.cs index f8b81bf6c0..89bb4d2923 100644 --- a/OpenRA.Mods.RA/Buildings/Util.cs +++ b/OpenRA.Mods.RA/Buildings/Util.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Buildings if (world.WorldActor.Trait().GetBuildingAt(a) != null) return false; if (world.ActorMap.GetUnitsAt(a).Any(b => b != toIgnore)) return false; - return world.Map.IsInMap(a) && bi.TerrainTypes.Contains(world.Map.GetTerrainInfo(a).Type); + return world.Map.Contains(a) && bi.TerrainTypes.Contains(world.Map.GetTerrainInfo(a).Type); } public static bool CanPlaceBuilding(this World world, string name, BuildingInfo building, CPos topLeft, Actor toIgnore) @@ -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) && res.GetResource(t) == null && + t => world.Map.Contains(t) && res.GetResource(t) == null && world.IsCellBuildable(t, building, toIgnore)); } diff --git a/OpenRA.Mods.RA/Combat.cs b/OpenRA.Mods.RA/Combat.cs index 85434ef1d6..ad28c5c17a 100644 --- a/OpenRA.Mods.RA/Combat.cs +++ b/OpenRA.Mods.RA/Combat.cs @@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA var world = firedBy.World; var targetTile = pos.ToCPos(); - if (!world.Map.IsInMap(targetTile)) + if (!world.Map.Contains(targetTile)) return; var isWater = pos.Z <= 0 && world.Map.GetTerrainInfo(targetTile).IsWater; diff --git a/OpenRA.Mods.RA/Crate.cs b/OpenRA.Mods.RA/Crate.cs index 883a87367b..09484ef770 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)) return false; + if (!self.World.Map.Contains(cell)) return false; var type = self.World.Map.GetTerrainInfo(cell).Type; if (!info.TerrainTypes.Contains(type)) diff --git a/OpenRA.Mods.RA/Effects/Missile.cs b/OpenRA.Mods.RA/Effects/Missile.cs index 8120e0bcca..1404b41639 100755 --- a/OpenRA.Mods.RA/Effects/Missile.cs +++ b/OpenRA.Mods.RA/Effects/Missile.cs @@ -160,7 +160,7 @@ namespace OpenRA.Mods.RA.Effects || (dist.LengthSquared < MissileCloseEnough.Range * MissileCloseEnough.Range) // Within range || (info.RangeLimit != 0 && ticks > info.RangeLimit) // Ran out of fuel || (!info.High && world.ActorMap.GetUnitsAt(cell).Any(a => a.HasTrait())) // Hit a wall - || !world.Map.IsInMap(cell) // This also avoids an IndexOutOfRangeException in GetTerrainInfo below. + || !world.Map.Contains(cell) // This also avoids an IndexOutOfRangeException in GetTerrainInfo below. || (!string.IsNullOrEmpty(info.BoundToTerrainType) && world.Map.GetTerrainInfo(cell).Type != info.BoundToTerrainType); // Hit incompatible terrain if (shouldExplode) diff --git a/OpenRA.Mods.RA/Husk.cs b/OpenRA.Mods.RA/Husk.cs index 4827b494b9..1fc5e813d9 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)) + if (!self.World.Map.Contains(cell)) return false; if (!info.AllowedTerrain.Contains(self.World.Map.GetTerrainInfo(cell).Type)) diff --git a/OpenRA.Mods.RA/Minelayer.cs b/OpenRA.Mods.RA/Minelayer.cs index 86bbf6f5d0..88d642bd5a 100644 --- a/OpenRA.Mods.RA/Minelayer.cs +++ b/OpenRA.Mods.RA/Minelayer.cs @@ -202,7 +202,7 @@ namespace OpenRA.Mods.RA return false; var location = target.CenterPosition.ToCPos(); - if (!self.World.Map.IsInMap(location)) + if (!self.World.Map.Contains(location)) return false; cursor = "ability"; diff --git a/OpenRA.Mods.RA/Move/Mobile.cs b/OpenRA.Mods.RA/Move/Mobile.cs index 4581b402f7..fcb964c020 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)) + if (!world.Map.Contains(cell)) return int.MaxValue; var index = world.Map.GetTerrainIndex(cell); @@ -580,7 +580,7 @@ namespace OpenRA.Mods.RA.Move if (self.Owner.Shroud.IsExplored(location)) cursor = self.World.Map.GetTerrainInfo(location).CustomCursor ?? cursor; - if (!self.World.Map.IsInMap(location) || (self.Owner.Shroud.IsExplored(location) && + if (!self.World.Map.Contains(location) || (self.Owner.Shroud.IsExplored(location) && unitType.MovementCostForCell(self.World, location) == int.MaxValue)) cursor = "move-blocked"; diff --git a/OpenRA.Mods.RA/Move/PathSearch.cs b/OpenRA.Mods.RA/Move/PathSearch.cs index a0aec53548..1b61a86814 100755 --- a/OpenRA.Mods.RA/Move/PathSearch.cs +++ b/OpenRA.Mods.RA/Move/PathSearch.cs @@ -178,7 +178,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)) + if (!world.Map.Contains(newHere)) continue; if (CellInfo[newHere].Seen) @@ -255,7 +255,7 @@ namespace OpenRA.Mods.RA.Move public void AddInitialCell(CPos location) { - if (!self.World.Map.IsInMap(location)) + if (!self.World.Map.Contains(location)) return; CellInfo[location] = new CellInfo(0, location, false); diff --git a/OpenRA.Mods.RA/RallyPoint.cs b/OpenRA.Mods.RA/RallyPoint.cs index 2fcb3f660d..3257659ab6 100755 --- a/OpenRA.Mods.RA/RallyPoint.cs +++ b/OpenRA.Mods.RA/RallyPoint.cs @@ -63,7 +63,7 @@ namespace OpenRA.Mods.RA return false; var location = target.CenterPosition.ToCPos(); - if (self.World.Map.IsInMap(location)) + if (self.World.Map.Contains(location)) { cursor = "ability"; return true; diff --git a/OpenRA.Mods.RA/Render/RenderLandingCraft.cs b/OpenRA.Mods.RA/Render/RenderLandingCraft.cs index 4203ed44b1..100c5a4a3f 100644 --- a/OpenRA.Mods.RA/Render/RenderLandingCraft.cs +++ b/OpenRA.Mods.RA/Render/RenderLandingCraft.cs @@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA.Render if (self.CenterPosition.Z > 0 || move.IsMoving) return false; - return cargo.CurrentAdjacentCells.Any(c => self.World.Map.IsInMap(c) + return cargo.CurrentAdjacentCells.Any(c => self.World.Map.Contains(c) && info.OpenTerrainTypes.Contains(self.World.Map.GetTerrainInfo(c).Type)); } diff --git a/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs b/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs index 2220f07b5a..ec7fb92a10 100644 --- a/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs +++ b/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs @@ -245,7 +245,7 @@ namespace OpenRA.Mods.RA public IEnumerable Order(World world, CPos xy, MouseInput mi) { world.CancelInputMode(); - if (mi.Button == expectedButton && world.Map.IsInMap(xy)) + if (mi.Button == expectedButton && world.Map.Contains(xy)) yield return new Order(order, manager.self, false) { TargetLocation = xy, SuppressVisualFeedback = true }; } @@ -258,6 +258,6 @@ namespace OpenRA.Mods.RA public IEnumerable Render(WorldRenderer wr, World world) { yield break; } public void RenderAfterWorld(WorldRenderer wr, World world) { } - public string GetCursor(World world, CPos xy, MouseInput mi) { return world.Map.IsInMap(xy) ? cursor : "generic-blocked"; } + public string GetCursor(World world, CPos xy, MouseInput mi) { return world.Map.Contains(xy) ? cursor : "generic-blocked"; } } } diff --git a/OpenRA.Mods.RA/World/DomainIndex.cs b/OpenRA.Mods.RA/World/DomainIndex.cs index d89de308d7..9b6704cca2 100644 --- a/OpenRA.Mods.RA/World/DomainIndex.cs +++ b/OpenRA.Mods.RA/World/DomainIndex.cs @@ -71,7 +71,7 @@ namespace OpenRA.Mods.RA public bool IsPassable(CPos p1, CPos p2) { - if (!map.IsInMap(p1) || !map.IsInMap(p2)) + if (!map.Contains(p1) || !map.Contains(p2)) return false; if (domains[p1] == domains[p2]) @@ -90,7 +90,7 @@ namespace OpenRA.Mods.RA { // Select all neighbors inside the map boundries var neighbors = CVec.directions.Select(d => d + cell) - .Where(c => map.IsInMap(c)); + .Where(c => map.Contains(c)); var found = false; foreach (var n in neighbors) @@ -208,7 +208,7 @@ namespace OpenRA.Mods.RA // Don't crawl off the map, or add already-visited cells var neighbors = CVec.directions.Select(d => n + d) - .Where(p => map.IsInMap(p) && !visited[p]); + .Where(p => map.Contains(p) && !visited[p]); foreach (var neighbor in neighbors) domainQueue.Enqueue(neighbor);