From cdad07d1728a58e5ee6f7cee4b90d94a2a39257c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 17 May 2019 23:52:13 +0100 Subject: [PATCH] Fix footprint type for line build structures. --- .../Orders/PlaceBuildingOrderGenerator.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs index d68bde42ff..99eea191c9 100644 --- a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs @@ -210,10 +210,18 @@ namespace OpenRA.Mods.Common.Orders throw new InvalidOperationException("LineBuild requires a 1x1 sized Building"); if (!Game.GetModifierKeys().HasModifier(Modifiers.Shift)) + { foreach (var t in BuildingUtils.GetLineBuildCells(world, topLeft, actorInfo, buildingInfo)) - footprint.Add(t.First, MakeCellType(buildingInfo.IsCloseEnoughToBase(world, world.LocalPlayer, actorInfo, t.First), true)); + { + var lineBuildable = world.IsCellBuildable(t.First, actorInfo, buildingInfo); + var lineCloseEnough = buildingInfo.IsCloseEnoughToBase(world, world.LocalPlayer, actorInfo, t.First); + footprint.Add(t.First, MakeCellType(lineBuildable && lineCloseEnough, true)); + } + } - footprint[topLeft] = MakeCellType(buildingInfo.IsCloseEnoughToBase(world, world.LocalPlayer, actorInfo, topLeft)); + var buildable = world.IsCellBuildable(topLeft, actorInfo, buildingInfo); + var closeEnough = buildingInfo.IsCloseEnoughToBase(world, world.LocalPlayer, actorInfo, topLeft); + footprint[topLeft] = MakeCellType(buildable && closeEnough); } else {