Selection can be null
This commit is contained in:
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user