SteamWar/FightSystem
Archiviert
13
1

Hotfix team join order

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-01-12 12:20:47 +01:00
Ursprung bafe06723a
Commit 21c0d95927

Datei anzeigen

@ -1,5 +1,6 @@
package de.steamwar.fightsystem.listener; package de.steamwar.fightsystem.listener;
import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.countdown.Countdown; import de.steamwar.fightsystem.countdown.Countdown;
import de.steamwar.fightsystem.countdown.NoPlayersOnlineCountdown; import de.steamwar.fightsystem.countdown.NoPlayersOnlineCountdown;
import de.steamwar.fightsystem.countdown.SetupOverCountdown; import de.steamwar.fightsystem.countdown.SetupOverCountdown;
@ -18,10 +19,10 @@ public class NormalJoinListener extends BasicListener {
FightTeam fightTeam = Fight.getPlayerTeam(player); FightTeam fightTeam = Fight.getPlayerTeam(player);
if (fightTeam == null) { if (fightTeam == null) {
if(Fight.getRedTeam().canbeLeader(player)) { if(!player.getUniqueId().equals(Config.RedLeader) && Fight.getBlueTeam().canbeLeader(player)) {
Fight.getRedTeam().setLeader(Fight.getRedTeam().addMember(player));
} else if(Fight.getBlueTeam().canbeLeader(player)) {
Fight.getBlueTeam().setLeader(Fight.getBlueTeam().addMember(player)); Fight.getBlueTeam().setLeader(Fight.getBlueTeam().addMember(player));
}else if(Fight.getRedTeam().canbeLeader(player)) {
Fight.getRedTeam().setLeader(Fight.getRedTeam().addMember(player));
} }
} }