Remove workarounds for querying the PlayerActor in Created
This commit is contained in:
@@ -56,13 +56,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
protected override void Created(Actor self)
|
||||
{
|
||||
// Special case handling is required for the Player actor.
|
||||
// Created is called before Player.PlayerActor is assigned,
|
||||
// so we must query other player traits from self, knowing that
|
||||
// it refers to the same actor as self.Owner.PlayerActor
|
||||
var playerActor = self.Info.Name == "player" ? self : self.Owner.PlayerActor;
|
||||
|
||||
techTree = playerActor.Trait<TechTree>();
|
||||
techTree = self.Owner.PlayerActor.Trait<TechTree>();
|
||||
|
||||
base.Created(self);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user