Cache world INotifySelection traits in Selection.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user