Update the MapCache with the correct UID.

This commit is contained in:
Paul Chote
2015-06-20 21:31:41 +01:00
parent 17d759c9be
commit cd1fdb9b36

View File

@@ -130,8 +130,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
map.RequiresMod = Game.ModData.Manifest.Mod.Id;
var combinedPath = Platform.ResolvePath(Path.Combine(directoryDropdown.Text, filename.Text + fileTypes[typeDropdown.Text]));
// Invalidate the old map metadata
Game.ModData.MapCache[map.Uid].Invalidate();
map.Save(combinedPath);
// Reload map to calculate new UID
map = new Map(combinedPath);
// Update the map cache so it can be loaded without restarting the game
var classification = mapDirectories[directoryDropdown.Text];
Game.ModData.MapCache[map.Uid].UpdateFromMap(map, classification);