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.SetPrefix();
|
||||
}
|
||||
|
||||
team.RemoveIfEmpty();
|
||||
Team.SaveList();
|
||||
} else {
|
||||
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.Remove(p.name);
|
||||
p.Game.Team = null;
|
||||
|
||||
team.RemoveIfEmpty();
|
||||
p.SetPrefix();
|
||||
Team.SaveList();
|
||||
}
|
||||
|
@ -62,6 +62,11 @@ namespace MCGalaxy.Games {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void RemoveIfEmpty() {
|
||||
if (Members.Count > 0) return;
|
||||
TeamsList.Remove(Name);
|
||||
}
|
||||
|
||||
public void UpdatePrefix() {
|
||||
foreach (string name in Members) {
|
||||
Player p = PlayerInfo.FindExact(name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user