From 6aeebe697f5fe7487e7c8d9188328445814eda28 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 20 Jun 2015 21:16:22 +0100 Subject: [PATCH] Default new maps to oramap. --- OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs index 6753f4ab98..40050b7667 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs @@ -104,7 +104,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic return item; }; - typeDropdown.Text = Path.GetExtension(map.Path); + typeDropdown.Text = map.Path != null ? Path.GetExtension(map.Path) : ".oramap"; if (string.IsNullOrEmpty(typeDropdown.Text)) typeDropdown.Text = fileTypes.First(t => t.Value == "").Key; @@ -137,7 +137,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic var combinedPath = Platform.ResolvePath(Path.Combine(directoryDropdown.Text, filename.Text + fileTypes[typeDropdown.Text])); // Invalidate the old map metadata - Game.ModData.MapCache[map.Uid].Invalidate(); + if (map.Uid != null) + Game.ModData.MapCache[map.Uid].Invalidate(); map.Save(combinedPath);