Make sure that ScreenMap is initialized before other traits.

This commit is contained in:
Paul Chote
2015-05-06 22:40:35 +01:00
parent 9e5e1f1a89
commit b889101ba1

View File

@@ -198,8 +198,16 @@ namespace OpenRA
public void LoadComplete(WorldRenderer wr)
{
// ScreenMap must be initialized before anything else
using (new Support.PerfTimer("ScreenMap.WorldLoaded"))
ScreenMap.WorldLoaded(this, wr);
foreach (var wlh in WorldActor.TraitsImplementing<IWorldLoaded>())
{
// These have already been initialized
if (wlh == ScreenMap)
continue;
using (new Support.PerfTimer(wlh.GetType().Name + ".WorldLoaded"))
wlh.WorldLoaded(this, wr);
}