Fix disbanding teams
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
bac1e3eaee
Commit
5715ea391c
@ -248,14 +248,15 @@ public class TeamCommand extends BasicCommand {
|
||||
if(notInTeam(player, user))
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
user.setTeam(0);
|
||||
|
||||
if(user.isLeader() && team.size() > 0){
|
||||
if(teamSize == 1){
|
||||
team.disband(user);
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren