Add player trait support for IWorldLoaded.

This commit is contained in:
Paul Chote
2019-04-11 21:14:50 +01:00
committed by reaperrr
parent e6750bf19c
commit 5d43417a5f

View File

@@ -234,16 +234,21 @@ namespace OpenRA
using (new PerfTimer("ScreenMap.WorldLoaded"))
ScreenMap.WorldLoaded(this, wr);
foreach (var wlh in WorldActor.TraitsImplementing<IWorldLoaded>())
foreach (var iwl in WorldActor.TraitsImplementing<IWorldLoaded>())
{
// These have already been initialized
if (wlh == ScreenMap)
if (iwl == ScreenMap)
continue;
using (new PerfTimer(wlh.GetType().Name + ".WorldLoaded"))
wlh.WorldLoaded(this, wr);
using (new PerfTimer(iwl.GetType().Name + ".WorldLoaded"))
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;
foreach (var player in Players)
gameInfo.AddPlayer(player, OrderManager.LobbyInfo);