Merge pull request #12533 from reaperrr/fix-air-smudges

Fix air explosions leaving smudges
This commit is contained in:
Oliver Brakmann
2017-01-03 21:56:17 +01:00
committed by GitHub

View File

@@ -25,10 +25,19 @@ namespace OpenRA.Mods.Common.Warheads
[Desc("Type of smudge to apply to terrain.")]
public readonly HashSet<string> SmudgeType = new HashSet<string>();
[Desc("How close to ground must the impact happen to spawn smudges.")]
public readonly WDist AirThreshold = new WDist(128);
public override void DoImpact(Target target, Actor firedBy, IEnumerable<int> damageModifiers)
{
var world = firedBy.World;
var targetTile = world.Map.CellContaining(target.CenterPosition);
var pos = target.CenterPosition;
var dat = world.Map.DistanceAboveTerrain(pos);
if (dat > AirThreshold)
return;
var targetTile = world.Map.CellContaining(pos);
var smudgeLayers = world.WorldActor.TraitsImplementing<SmudgeLayer>().ToDictionary(x => x.Info.Type);
var minRange = (Size.Length > 1 && Size[1] > 0) ? Size[1] : 0;