From 5715ea391c2998f69d5208ffcbe7aab19f61d8fe Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 24 May 2021 09:37:14 +0200 Subject: [PATCH] Fix disbanding teams Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/commands/TeamCommand.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/TeamCommand.java b/src/de/steamwar/bungeecore/commands/TeamCommand.java index 16c9873..af3a84b 100644 --- a/src/de/steamwar/bungeecore/commands/TeamCommand.java +++ b/src/de/steamwar/bungeecore/commands/TeamCommand.java @@ -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); }