From b889101ba1cdc854133304af4d3a780f60fac6a3 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 6 May 2015 22:40:35 +0100 Subject: [PATCH] Make sure that ScreenMap is initialized before other traits. --- OpenRA.Game/World.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index aab063b763..b93f73b73d 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -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()) { + // These have already been initialized + if (wlh == ScreenMap) + continue; + using (new Support.PerfTimer(wlh.GetType().Name + ".WorldLoaded")) wlh.WorldLoaded(this, wr); }