From 4b1e243df353153f6f220d78fcbffacbe339817e Mon Sep 17 00:00:00 2001 From: reaperrr Date: Thu, 7 Jul 2016 00:56:23 +0200 Subject: [PATCH] Make smudges not spawn or grow when cell contains invalid target This can be used to prevent smudges to spawn below buildings, vehicles etc. --- OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs b/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs index a1743e0a6c..b05a0ea984 100644 --- a/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs @@ -38,7 +38,12 @@ namespace OpenRA.Mods.Common.Warheads foreach (var sc in allCells) { var smudgeType = world.Map.GetTerrainInfo(sc).AcceptsSmudgeType.FirstOrDefault(SmudgeType.Contains); - if (smudgeType == null) continue; + if (smudgeType == null) + continue; + + var cellActors = world.ActorMap.GetActorsAt(sc); + if (cellActors.Any(a => !IsValidAgainst(a, firedBy))) + continue; SmudgeLayer smudgeLayer; if (!smudgeLayers.TryGetValue(smudgeType, out smudgeLayer))