From 10dc6ca85c6952b22cf0e4b34e17e08abf7b0085 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Tue, 26 Apr 2016 18:48:41 +0200 Subject: [PATCH] CreateEffectWarhead.TargetSearchRadius lint check --- .../Lint/CheckTargetHealthRadius.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Lint/CheckTargetHealthRadius.cs b/OpenRA.Mods.Common/Lint/CheckTargetHealthRadius.cs index 7e88927503..cc6d46e3fe 100644 --- a/OpenRA.Mods.Common/Lint/CheckTargetHealthRadius.cs +++ b/OpenRA.Mods.Common/Lint/CheckTargetHealthRadius.cs @@ -47,7 +47,20 @@ namespace OpenRA.Mods.Common.Lint continue; if (healthTraits.Where(x => x.Shape.OuterRadius.Length > warhead.TargetExtraSearchRadius.Length).Any()) - emitError("Actor type `{0}` has a health radius exceeding the victim scan radius of a warhead on `{1}`!" + emitError("Actor type `{0}` has a health radius exceeding the victim scan radius of a SpreadDamageWarhead on `{1}`!" + .F(actorInfo.Key, weaponInfo.Key)); + } + + var effectWarheads = weaponInfo.Value.Warheads.OfType(); + + foreach (var warhead in effectWarheads) + { + // This warhead cannot affect this actor. + if (!warhead.ValidTargets.Overlaps(targetable)) + continue; + + if (healthTraits.Where(x => x.Shape.OuterRadius.Length > warhead.TargetSearchRadius.Length).Any()) + emitError("Actor type `{0}` has a health radius exceeding the victim scan radius of a CreateEffectWarhead on `{1}`!" .F(actorInfo.Key, weaponInfo.Key)); }