Replace usage of the Stances dict by a method call
This commit is contained in:
@@ -76,7 +76,7 @@ namespace OpenRA.Mods.Common.Warheads
|
||||
// (and to prevent returning ImpactActorType.Invalid on AffectsParent=false)
|
||||
public override bool IsValidAgainst(Actor victim, Actor firedBy)
|
||||
{
|
||||
var stance = firedBy.Owner.Stances[victim.Owner];
|
||||
var stance = firedBy.Owner.RelationshipWith(victim.Owner);
|
||||
if (!ValidStances.HasStance(stance))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Warheads
|
||||
if (!AffectsParent && victim == firedBy)
|
||||
return false;
|
||||
|
||||
var stance = firedBy.Owner.Stances[victim.Owner];
|
||||
var stance = firedBy.Owner.RelationshipWith(victim.Owner);
|
||||
if (!ValidStances.HasStance(stance))
|
||||
return false;
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Warheads
|
||||
return false;
|
||||
|
||||
// AffectsParent checks do not make sense for FrozenActors, so skip to stance checks
|
||||
var stance = firedBy.Owner.Stances[victim.Owner];
|
||||
var stance = firedBy.Owner.RelationshipWith(victim.Owner);
|
||||
if (!ValidStances.HasStance(stance))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user