Store map packages in MapPreview.

This commit is contained in:
Paul Chote
2016-02-20 17:50:04 +00:00
parent 226081d379
commit d492c23a6d
12 changed files with 102 additions and 103 deletions

View File

@@ -737,14 +737,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (MapPreview.Uid == uid)
return;
MapPreview = Game.ModData.MapCache[uid];
var modData = Game.ModData;
MapPreview = modData.MapCache[uid];
Map = null;
if (MapPreview.Status == MapStatus.Available)
{
// Maps need to be validated and pre-loaded before they can be accessed
new Thread(_ =>
{
var currentMap = Map = new Map(MapPreview.Path);
var currentMap = Map = new Map(modData, MapPreview.Package);
currentMap.PreloadRules();
Game.RunAfterTick(() =>
{