mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 12:42:22 -04:00
Fix empty teams not being removed. (Thanks goodlyay)
This commit is contained in:
parent
cc5550fd8d
commit
4a6f46d626
@ -89,6 +89,8 @@ namespace MCGalaxy.Commands {
|
|||||||
who.Game.Team = null;
|
who.Game.Team = null;
|
||||||
who.SetPrefix();
|
who.SetPrefix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
team.RemoveIfEmpty();
|
||||||
Team.SaveList();
|
Team.SaveList();
|
||||||
} else {
|
} else {
|
||||||
Player.Message(p, "The given player was not found. You need to use their full account name.");
|
Player.Message(p, "The given player was not found. You need to use their full account name.");
|
||||||
@ -168,6 +170,8 @@ namespace MCGalaxy.Commands {
|
|||||||
team.Action(p, "left the team.");
|
team.Action(p, "left the team.");
|
||||||
team.Remove(p.name);
|
team.Remove(p.name);
|
||||||
p.Game.Team = null;
|
p.Game.Team = null;
|
||||||
|
|
||||||
|
team.RemoveIfEmpty();
|
||||||
p.SetPrefix();
|
p.SetPrefix();
|
||||||
Team.SaveList();
|
Team.SaveList();
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,12 @@ namespace MCGalaxy.Games {
|
|||||||
Members.RemoveAt(i); return true;
|
Members.RemoveAt(i); return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RemoveIfEmpty() {
|
||||||
|
if (Members.Count > 0) return;
|
||||||
|
TeamsList.Remove(Name);
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdatePrefix() {
|
public void UpdatePrefix() {
|
||||||
foreach (string name in Members) {
|
foreach (string name in Members) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user