From 8750f04f4c866576255f4260f1b85425c2b2a887 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 21 Apr 2013 11:38:24 +1200 Subject: [PATCH] avoid spurious re-indexing of maps just prior to shellmap load --- OpenRA.Game/Game.cs | 2 +- OpenRA.Game/ModData.cs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 4383978ed9..3e8a69fa0f 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -313,7 +313,7 @@ namespace OpenRA modData = new ModData( mm ); Renderer.InitializeFonts(modData.Manifest); - modData.LoadInitialAssets(); + modData.LoadInitialAssets(true); PerfHistory.items["render"].hasNormalTick = false; diff --git a/OpenRA.Game/ModData.cs b/OpenRA.Game/ModData.cs index c614d4604b..eed1bab85c 100755 --- a/OpenRA.Game/ModData.cs +++ b/OpenRA.Game/ModData.cs @@ -39,7 +39,7 @@ namespace OpenRA WidgetLoader = new WidgetLoader( this ); } - public void LoadInitialAssets() + public void LoadInitialAssets(bool enumMaps) { // all this manipulation of static crap here is nasty and breaks // horribly when you use ModData in unexpected ways. @@ -48,7 +48,8 @@ namespace OpenRA foreach (var dir in Manifest.Folders) FileSystem.Mount(dir); - AvailableMaps = FindMaps(Manifest.Mods); + if (enumMaps) + AvailableMaps = FindMaps(Manifest.Mods); ChromeMetrics.Initialize(Manifest.ChromeMetrics); ChromeProvider.Initialize(Manifest.Chrome); @@ -65,7 +66,7 @@ namespace OpenRA var map = new Map(AvailableMaps[uid].Path); // Reinit all our assets - LoadInitialAssets(); + LoadInitialAssets(false); foreach (var pkg in Manifest.Packages) FileSystem.Mount(pkg);