Selection can be null

This commit is contained in:
Gustas
2025-12-30 22:21:41 +02:00
committed by Paul Chote
parent b2f32f8907
commit ec7e5021ae

View File

@@ -323,14 +323,19 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void Select(string savePath) void Select(string savePath)
{ {
selectedPath = savePath; selectedPath = savePath;
selectedSave = new GameSave(savePath);
var map = modData.MapCache[selectedSave.GlobalSettings.Map]; if (savePath != null)
if (map.Status != MapStatus.Available && selectedSave.MapGenerationArgs != null)
{ {
// Add to the MapCache so the server will accept the map selectedSave = new GameSave(savePath);
modData.MapCache.GenerateMap(modData, selectedSave.MapGenerationArgs); var map = modData.MapCache[selectedSave.GlobalSettings.Map];
if (map.Status != MapStatus.Available && selectedSave.MapGenerationArgs != null)
{
// Add to the MapCache so the server will accept the map
modData.MapCache.GenerateMap(modData, selectedSave.MapGenerationArgs);
}
} }
else
selectedSave = null;
if (isSavePanel) if (isSavePanel)
{ {