From fb2b63c7f81733dc425adabf57af8e52f9b4e7ce Mon Sep 17 00:00:00 2001 From: UberWaffe Date: Sat, 9 Aug 2014 19:36:43 +0200 Subject: [PATCH] #6030 regression fix. Added EffectivenessAgainst <= 0 check to IsvalidAgainst for Warhead. --- OpenRA.Game/GameRules/Warhead.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenRA.Game/GameRules/Warhead.cs b/OpenRA.Game/GameRules/Warhead.cs index c2ad6eb4e1..f34c88329e 100644 --- a/OpenRA.Game/GameRules/Warhead.cs +++ b/OpenRA.Game/GameRules/Warhead.cs @@ -58,6 +58,10 @@ namespace OpenRA.GameRules public bool IsValidAgainst(Actor victim, Actor firedBy) { + // If this warhead is ineffective against the target, then it is not a valid target + if (EffectivenessAgainst(victim.Info) <= 0f) + return false; + // A target type is valid if it is in the valid targets list, and not in the invalid targets list. return InTargetList(victim, firedBy, ValidTargets) && !InTargetList(victim, firedBy, InvalidTargets); @@ -79,6 +83,10 @@ namespace OpenRA.GameRules public bool IsValidAgainst(FrozenActor victim, Actor firedBy) { + // If this warhead is ineffective against the target, then it is not a valid target + if (EffectivenessAgainst(victim.Info) <= 0f) + return false; + // A target type is valid if it is in the valid targets list, and not in the invalid targets list. return InTargetList(victim, firedBy, ValidTargets) && !InTargetList(victim, firedBy, InvalidTargets);