From 74da2a2c7248d86cda953d17f91238544216adad Mon Sep 17 00:00:00 2001 From: reaperrr Date: Wed, 26 Aug 2015 22:20:30 +0200 Subject: [PATCH] Add TargetExtraSearchRadius to SpreadDamageWarhead Allows to customize the victim scan radius. Necessary to ensure that actors where health radius is close enough, but CenterPosition isn't, properly receive damage. --- OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs b/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs index 53c3946f1d..6a0e11255e 100644 --- a/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs @@ -19,6 +19,9 @@ namespace OpenRA.Mods.Common.Warheads [Desc("Range between falloff steps.")] public readonly WDist Spread = new WDist(43); + [Desc("Extra search radius beyond maximum spread. Required to ensure damage to actors with large health radius.")] + public readonly WDist TargetExtraSearchRadius = new WDist(2048); + [Desc("Damage percentage at each range step")] public readonly int[] Falloff = { 100, 37, 14, 5, 2, 1, 0 }; @@ -46,7 +49,10 @@ namespace OpenRA.Mods.Common.Warheads InitializeRange(); var world = firedBy.World; - var hitActors = world.FindActorsInCircle(pos, Range[Range.Length - 1]); + + // This only finds actors where the center is within the search radius, + // so we need to search beyond the maximum spread to account for actors with large health radius + var hitActors = world.FindActorsInCircle(pos, Range[Range.Length - 1] + TargetExtraSearchRadius); foreach (var victim in hitActors) {