Merge pull request #9174 from reaperrr/radius-explode

Customizable impact victim scan radius
This commit is contained in:
RoosterDragon
2015-09-30 20:28:17 +01:00
4 changed files with 71 additions and 3 deletions

View File

@@ -166,8 +166,14 @@ namespace OpenRA.Mods.Common.Effects
if (info.ContrailLength > 0)
contrail.Update(pos);
if (ticks++ >= length || (info.Blockable && world.ActorMap
.GetUnitsAt(world.Map.CellContaining(pos)).Any(a => a.Info.HasTraitInfo<IBlocksProjectilesInfo>())))
var cell = world.Map.CellContaining(pos);
var height = world.Map.DistanceAboveTerrain(pos);
var shouldExplode = height.Length <= 0 // Hit the ground
|| ticks++ >= length // Flight length reached/exceeded
|| (info.Blockable && world.ActorMap.GetUnitsAt(cell).Any(a => a.Info.HasTraitInfo<IBlocksProjectilesInfo>())); // Hit a wall or other blocking obstacle
if (shouldExplode)
Explode(world);
}