Simplify CmdOverseer a tiny bit

This commit is contained in:
UnknownShadow200 2017-08-10 17:44:21 +10:00
parent a5d492043d
commit 44e63db1bd
2 changed files with 5 additions and 10 deletions

View File

@ -97,16 +97,13 @@ namespace MCGalaxy.Commands.World {
static string NextLevel(Player p) {
string level = p.name.ToLower();
if (LevelInfo.MapExists(level) || LevelInfo.MapExists(level + "00")) {
for (int i = 2; i < p.group.OverseerMaps + 2; i++) {
// subtract 1, because we accounted for it in above if statement
for (int i = 2; i < (p.group.OverseerMaps - 1) + 2; i++) {
if (LevelInfo.MapExists(p.name.ToLower() + i)) continue;
if(i > p.group.OverseerMaps) {
Player.Message(p, "You have reached the limit for your overseer maps."); return null;
}
return p.name.ToLower() + i;
}
if (level == p.name.ToLower()) {
Player.Message(p, "You have reached the limit for your overseer maps."); return null;
}
Player.Message(p, "You have reached the limit for your overseer maps."); return null;
}
return level;
}

View File

@ -73,9 +73,7 @@ namespace MCGalaxy {
/// <summary> Find partial matches of 'name' against the list of ranks. </summary>
public static Group FindRanks(Player p, string name) {
name = name.ToLower();
Group.MapName(ref name);
Group.MapName(ref name);
int matches = 0;
return Find<Group>(p, name, out matches, Group.GroupList,
null, g => Colors.Strip(g.Name), "ranks");