From 93d463365a7eab4c54939146445298a211c491ff Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Thu, 15 Apr 2021 18:54:21 +0200 Subject: [PATCH] Fixed Empty Team --- src/de/steamwar/bungeecore/commands/TeamCommand.java | 2 +- src/de/steamwar/bungeecore/sql/Team.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/TeamCommand.java b/src/de/steamwar/bungeecore/commands/TeamCommand.java index 0fad2f1..e8405eb 100644 --- a/src/de/steamwar/bungeecore/commands/TeamCommand.java +++ b/src/de/steamwar/bungeecore/commands/TeamCommand.java @@ -255,7 +255,7 @@ public class TeamCommand extends BasicCommand { user.setTeam(0); if(user.isLeader() && team.size() > 0){ - team.disband(); + team.disband(user); } Message.send("TEAM_LEAVE_LEFT", player); diff --git a/src/de/steamwar/bungeecore/sql/Team.java b/src/de/steamwar/bungeecore/sql/Team.java index 1256a1a..6df9073 100644 --- a/src/de/steamwar/bungeecore/sql/Team.java +++ b/src/de/steamwar/bungeecore/sql/Team.java @@ -154,8 +154,9 @@ public class Team { } } - public void disband(){ - SQL.update("UPDATE Team SET TeamDeleted = 1, TeamLeader = NULL WHERE TeamID = ?", teamId); + public void disband(SteamwarUser user){ + user.setLeader(false); + SQL.update("UPDATE Team SET TeamDeleted = 1", teamId); teamCache.remove(this); }