Replace usage of the Stances dict by a method call

This commit is contained in:
abcdefg30
2020-09-25 17:02:25 +02:00
committed by Paul Chote
parent eda9966d27
commit 10f645bf77
55 changed files with 104 additions and 107 deletions

View File

@@ -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;

View File

@@ -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;