Fix ignored 'Failed to save map' #13036

This commit is contained in:
rob-v
2017-04-18 16:02:36 +02:00
parent 4c990e48d7
commit 63de0bb910

View File

@@ -191,11 +191,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
map.Save(package);
}
catch
{
Console.WriteLine("Failed to save map at {0}", combinedPath);
}
// Update the map cache so it can be loaded without restarting the game
modData.MapCache[map.Uid].UpdateFromMap(map.Package, selectedDirectory.Folder, selectedDirectory.Classification, null, map.Grid.Type);
@@ -204,6 +199,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Ui.CloseWindow();
onSave(map.Uid);
}
catch (Exception e)
{
Log.Write("debug", "Failed to save map at {0}: {1}", combinedPath, e.Message);
ConfirmationDialogs.ButtonPrompt(
title: "Failed to save map",
text: "See debug.log for details.",
onConfirm: () => { },
confirmText: "Ok");
}
};
}
}