Replace usage of the Stances dict by a method call
This commit is contained in:
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
isEnemyUnit = unit =>
|
||||
player.Stances[unit.Owner] == PlayerRelationship.Enemy
|
||||
player.RelationshipWith(unit.Owner) == PlayerRelationship.Enemy
|
||||
&& !unit.Info.HasTraitInfo<HuskInfo>()
|
||||
&& unit.Info.HasTraitInfo<ITargetableInfo>();
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
var randPlayer = world.Players.Where(p => !p.Spectating
|
||||
&& Info.CapturableStances.HasStance(player.Stances[p])).Random(world.LocalRandom);
|
||||
&& Info.CapturableStances.HasStance(player.RelationshipWith(p))).Random(world.LocalRandom);
|
||||
|
||||
var targetOptions = Info.CheckCaptureTargetsForVisibility
|
||||
? GetVisibleActorsBelongingToPlayer(randPlayer)
|
||||
|
||||
Reference in New Issue
Block a user