mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Simplify CmdOverseer a tiny bit
This commit is contained in:
parent
a5d492043d
commit
44e63db1bd
@ -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;
|
||||
}
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user