From 05e1841e0edd44720ff872075ba03d964947917c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 10 Jul 2014 17:06:57 +1200 Subject: [PATCH] Add AllowInvalidPlacement check to IsCellBuildable. Fixes #5902. --- OpenRA.Mods.RA/Buildings/Util.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/Buildings/Util.cs b/OpenRA.Mods.RA/Buildings/Util.cs index 89bb4d2923..285ece10a2 100644 --- a/OpenRA.Mods.RA/Buildings/Util.cs +++ b/OpenRA.Mods.RA/Buildings/Util.cs @@ -23,8 +23,11 @@ namespace OpenRA.Mods.RA.Buildings public static bool IsCellBuildable(this World world, CPos a, BuildingInfo bi, Actor toIgnore) { - if (world.WorldActor.Trait().GetBuildingAt(a) != null) return false; - if (world.ActorMap.GetUnitsAt(a).Any(b => b != toIgnore)) return false; + if (world.WorldActor.Trait().GetBuildingAt(a) != null) + return false; + + if (!bi.AllowInvalidPlacement && world.ActorMap.GetUnitsAt(a).Any(b => b != toIgnore)) + return false; return world.Map.Contains(a) && bi.TerrainTypes.Contains(world.Map.GetTerrainInfo(a).Type); }