SteamWar/BungeeCore
Archiviert
13
2

Fix disbanding teams

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2021-05-24 09:37:14 +02:00
Ursprung bac1e3eaee
Commit 5715ea391c

Datei anzeigen

@ -248,14 +248,15 @@ public class TeamCommand extends BasicCommand {
if(notInTeam(player, user)) if(notInTeam(player, user))
return; return;
if(team.size() > 1 && user.isLeader() && team.getMembers().stream().map(SteamwarUser::get).filter(member -> user != member).noneMatch(SteamwarUser::isLeader)){ int teamSize = team.size();
if(teamSize > 1 && user.isLeader() && team.getMembers().stream().map(SteamwarUser::get).filter(member -> user != member).noneMatch(SteamwarUser::isLeader)){
Message.send("TEAM_OTHER_LEADER_REQUIRED", player); Message.send("TEAM_OTHER_LEADER_REQUIRED", player);
return; return;
} }
user.setTeam(0); user.setTeam(0);
if(user.isLeader() && team.size() > 0){ if(teamSize == 1){
team.disband(user); team.disband(user);
} }