add NoAvailableMaps exception.
modify ChooseInitialMap to throw NoAvailalbeMaps exception if no maps were loaded. implement Utilities.TryWithPrompt - safe execution of a provided action with ability to prompt user on error.
This commit is contained in:
@@ -332,8 +332,8 @@ namespace OpenRA
|
||||
if (string.IsNullOrEmpty(initialUid) || previews[initialUid].Status != MapStatus.Available)
|
||||
{
|
||||
var selected = previews.Values.Where(IsSuitableInitialMap).RandomOrDefault(random) ??
|
||||
previews.Values.First(m => m.Status == MapStatus.Available && m.Visibility.HasFlag(MapVisibility.Lobby));
|
||||
return selected.Uid;
|
||||
previews.Values.FirstOrDefault(m => m.Status == MapStatus.Available && m.Visibility.HasFlag(MapVisibility.Lobby));
|
||||
return selected == null ? string.Empty : selected.Uid;
|
||||
}
|
||||
|
||||
return initialUid;
|
||||
|
||||
Reference in New Issue
Block a user