diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs index 9ae83826d8..f23752e1c8 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs @@ -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);