diff --git a/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs b/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs index 6863f92587..98650a6b66 100644 --- a/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs @@ -30,6 +30,9 @@ namespace OpenRA.Mods.Common.Warheads [Desc("Remap explosion effect to player color, if art supports it.")] public readonly bool UsePlayerPalette = false; + [Desc("Search radius around impact for 'direct hit' check.")] + public readonly WDist TargetSearchRadius = new WDist(2048); + [Desc("List of sounds that can be played on impact.")] public readonly string[] ImpactSounds = new string[0]; @@ -72,7 +75,7 @@ namespace OpenRA.Mods.Common.Warheads public bool GetDirectHit(World world, CPos cell, WPos pos, Actor firedBy, bool checkTargetType = false) { - foreach (var unit in world.ActorMap.GetActorsAt(cell)) + foreach (var unit in world.FindActorsInCircle(pos, TargetSearchRadius)) { if (checkTargetType && !IsValidAgainst(unit, firedBy)) continue;