Add player trait support for IWorldLoaded.
This commit is contained in:
@@ -234,16 +234,21 @@ namespace OpenRA
|
|||||||
using (new PerfTimer("ScreenMap.WorldLoaded"))
|
using (new PerfTimer("ScreenMap.WorldLoaded"))
|
||||||
ScreenMap.WorldLoaded(this, wr);
|
ScreenMap.WorldLoaded(this, wr);
|
||||||
|
|
||||||
foreach (var wlh in WorldActor.TraitsImplementing<IWorldLoaded>())
|
foreach (var iwl in WorldActor.TraitsImplementing<IWorldLoaded>())
|
||||||
{
|
{
|
||||||
// These have already been initialized
|
// These have already been initialized
|
||||||
if (wlh == ScreenMap)
|
if (iwl == ScreenMap)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
using (new PerfTimer(wlh.GetType().Name + ".WorldLoaded"))
|
using (new PerfTimer(iwl.GetType().Name + ".WorldLoaded"))
|
||||||
wlh.WorldLoaded(this, wr);
|
iwl.WorldLoaded(this, wr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var p in Players)
|
||||||
|
foreach (var iwl in p.PlayerActor.TraitsImplementing<IWorldLoaded>())
|
||||||
|
using (new PerfTimer(iwl.GetType().Name + ".WorldLoaded"))
|
||||||
|
iwl.WorldLoaded(this, wr);
|
||||||
|
|
||||||
gameInfo.StartTimeUtc = DateTime.UtcNow;
|
gameInfo.StartTimeUtc = DateTime.UtcNow;
|
||||||
foreach (var player in Players)
|
foreach (var player in Players)
|
||||||
gameInfo.AddPlayer(player, OrderManager.LobbyInfo);
|
gameInfo.AddPlayer(player, OrderManager.LobbyInfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user