Fix LS with non-existent ranks

This commit is contained in:
UnknownShadow200 2017-04-25 16:44:00 +10:00
parent b2d4702919
commit e28db73fdc

View File

@ -46,6 +46,7 @@ namespace MCGalaxy.Games {
} }
void ProcessSettingsLine(string key, string value) { void ProcessSettingsLine(string key, string value) {
LevelPermission perm;
switch (key.ToLower()) { switch (key.ToLower()) {
case "start-on-startup": startOnStartup = bool.Parse(value); break; case "start-on-startup": startOnStartup = bool.Parse(value); break;
case "send-afk-to-main": sendAfkMain = bool.Parse(value); break; case "send-afk-to-main": sendAfkMain = bool.Parse(value); break;
@ -54,12 +55,12 @@ namespace MCGalaxy.Games {
case "lives": lifeNum = int.Parse(value); break; case "lives": lifeNum = int.Parse(value); break;
case "setup-rank": case "setup-rank":
if (Group.Find(value) != null) perm = Group.ParsePermOrName(value);
setupRank = Group.Find(value).Permission; if (perm != LevelPermission.Null) setupRank = perm;
break; break;
case "control-rank": case "control-rank":
if (Group.Find(value) != null) perm = Group.ParsePermOrName(value);
controlRank = Group.Find(value).Permission; if (perm != LevelPermission.Null) controlRank = perm;
break; break;
case "maps": case "maps":
foreach (string name in value.Split(',')) { foreach (string name in value.Split(',')) {
@ -79,8 +80,8 @@ namespace MCGalaxy.Games {
w.WriteLine("vote-count = " + voteCount); w.WriteLine("vote-count = " + voteCount);
w.WriteLine("vote-time = " + voteTime); w.WriteLine("vote-time = " + voteTime);
w.WriteLine("lives = " + lifeNum); w.WriteLine("lives = " + lifeNum);
w.WriteLine("setup-rank = " + Group.GetName(setupRank)); w.WriteLine("setup-rank = " + (int)setupRank);
w.WriteLine("control-rank = " + Group.GetName(controlRank)); w.WriteLine("control-rank = " + (int)controlRank);
w.WriteLine("maps = " + maps.Join()); w.WriteLine("maps = " + maps.Join());
} }
} }