Give a sensible error if LoadScreen/LobbyDefaults is missing.

This commit is contained in:
Paul Chote
2015-03-08 17:15:00 +00:00
parent 762c0e12a2
commit 60937b096b

View File

@@ -92,8 +92,12 @@ namespace OpenRA
Missions = YamlList(yaml, "Missions", true);
ServerTraits = YamlList(yaml, "ServerTraits");
LoadScreen = yaml["LoadScreen"];
LobbyDefaults = yaml["LobbyDefaults"];
if (!yaml.TryGetValue("LoadScreen", out LoadScreen))
throw new InvalidDataException("`LoadScreen` section is not defined.");
if (!yaml.TryGetValue("LobbyDefaults", out LobbyDefaults))
throw new InvalidDataException("`LobbyDefaults` section is not defined.");
Fonts = yaml["Fonts"].ToDictionary(my =>
{