Fix default difficulty not being serialised

This commit is contained in:
Scott_NZ
2012-12-11 14:31:17 +13:00
parent 988a68dae5
commit a8dbedd486
2 changed files with 8 additions and 4 deletions

View File

@@ -498,6 +498,12 @@ namespace OpenRA.Mods.RA.Server
.Select(p => MakeSlotFromPlayerReference(p.Value))
.Where(s => s != null)
.ToDictionary(s => s.PlayerReference, s => s);
if (server.Map.Difficulties != null && server.Map.Difficulties.Any())
if (!server.Map.Difficulties.Contains(server.lobbyInfo.GlobalSettings.Difficulty))
server.lobbyInfo.GlobalSettings.Difficulty = server.Map.Difficulties.First();
else
server.lobbyInfo.GlobalSettings.Difficulty = null;
}
}
}