Make smudges not spawn or grow when cell contains invalid target

This can be used to prevent smudges to spawn below buildings, vehicles etc.
This commit is contained in:
reaperrr
2016-07-07 00:56:23 +02:00
parent 93b7847ce2
commit 4b1e243df3

View File

@@ -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))