remove duplication of initial map choice logic

This commit is contained in:
Chris Forbes
2011-07-28 22:25:54 +12:00
parent b748e4b11b
commit cfa8298190
4 changed files with 21 additions and 14 deletions

View File

@@ -143,10 +143,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
void StartSkirmishGame()
{
var maps = Game.modData.AvailableMaps;
var last = Game.Settings.Server.Map;
var map = !string.IsNullOrEmpty(last) && maps.ContainsKey(last) ? last :
maps.FirstOrDefault(m => m.Value.Selectable).Key;
var map = CncWidgetUtils.ChooseInitialMap(Game.Settings.Server.Map);
CncConnectingLogic.Connect(IPAddress.Loopback.ToString(),
Game.CreateLocalServer(map),