Cache world INotifySelection traits in Selection.

This commit is contained in:
Paul Chote
2019-01-20 12:22:30 +00:00
parent 64c853a4e0
commit 0df159e73b
4 changed files with 16 additions and 6 deletions

View File

@@ -142,7 +142,7 @@ namespace OpenRA
}
}
public readonly Selection Selection = new Selection();
public readonly Selection Selection;
public void CancelInputMode() { OrderGenerator = new UnitOrderGenerator(); }
@@ -179,6 +179,8 @@ namespace OpenRA
ActorMap = WorldActor.Trait<IActorMap>();
ScreenMap = WorldActor.Trait<ScreenMap>();
Selection = new Selection(WorldActor.TraitsImplementing<INotifySelection>());
// Add players
foreach (var cmp in WorldActor.TraitsImplementing<ICreatePlayers>())
cmp.CreatePlayers(this);