diff --git a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs index 278c7fce51..ab5c5c5701 100644 --- a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs @@ -229,7 +229,7 @@ namespace OpenRA.Mods.Common.Orders return false; var location = host.Location; - return host.TraitsImplementing().Any(p => location + p.Info.Offset == cell && p.AcceptsPlug(host, plug.Type)); + return host.TraitsImplementing().Any(p => p.AcceptsPlug(host, plug.Type)); } IEnumerable IOrderGenerator.Render(WorldRenderer wr, World world) { yield break; } diff --git a/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs b/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs index 2b67a0f9fe..fc6852e3c3 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs @@ -144,8 +144,11 @@ namespace OpenRA.Mods.Common.Traits return; var location = host.Location; - var pluggable = host.TraitsImplementing() - .FirstOrDefault(p => location + p.Info.Offset == targetLocation && p.AcceptsPlug(host, plugInfo.Type)); + var pluggableLocations = host.TraitsImplementing() + .Where(p => p.AcceptsPlug(host, plugInfo.Type)); + + var pluggable = pluggableLocations.FirstOrDefault(p => location + p.Info.Offset == targetLocation) + ?? pluggableLocations.FirstOrDefault(); if (pluggable == null) return;