Replace usage of the Stances dict by a method call
This commit is contained in:
@@ -167,7 +167,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
foreach (var bp in world.ActorsWithTrait<BaseProvider>())
|
||||
{
|
||||
var validOwner = bp.Actor.Owner == p || (allyBuildEnabled && bp.Actor.Owner.Stances[p] == PlayerRelationship.Ally);
|
||||
var validOwner = bp.Actor.Owner == p || (allyBuildEnabled && bp.Actor.Owner.RelationshipWith(p) == PlayerRelationship.Ally);
|
||||
if (!validOwner || !bp.Trait.Ready())
|
||||
continue;
|
||||
|
||||
@@ -211,13 +211,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
for (var x = scanStart.X; x < scanEnd.X; x++)
|
||||
{
|
||||
var pos = new CPos(x, y);
|
||||
|
||||
foreach (var a in world.ActorMap.GetActorsAt(pos))
|
||||
{
|
||||
if (!a.IsInWorld)
|
||||
continue;
|
||||
|
||||
if (a.Owner != p && (!allyBuildEnabled || a.Owner.Stances[p] != PlayerRelationship.Ally))
|
||||
if (a.Owner != p && (!allyBuildEnabled || a.Owner.RelationshipWith(p) != PlayerRelationship.Ally))
|
||||
continue;
|
||||
|
||||
if (ActorGrantsValidArea(a, requiresBuildableArea))
|
||||
|
||||
Reference in New Issue
Block a user