Fix broken player count when changing max players
This commit is contained in:
parent
1957db25d9
commit
706b3e25ef
@ -108,6 +108,7 @@ public class GameLobbyManager implements Listener, IPacketHandler
|
||||
private NautHashMap<Player, String> _kitMap = new NautHashMap<Player, String>();
|
||||
|
||||
private int _oldPlayerCount = 0;
|
||||
private String _playerCountKey = ""; // Used for scoreboard when max player count changes
|
||||
|
||||
private boolean _handlingPacket = false;
|
||||
|
||||
@ -965,8 +966,8 @@ public class GameLobbyManager implements Listener, IPacketHandler
|
||||
|
||||
objective.getScore(C.cYellow + "Players").setScore(line--);
|
||||
|
||||
// Remove old
|
||||
entry.getValue().resetScores(_oldPlayerCount + "/" + Manager.GetPlayerFull());
|
||||
// Remove Old
|
||||
entry.getValue().resetScores(_playerCountKey);
|
||||
// Set new
|
||||
objective.getScore(UtilServer.getPlayers().length + "/" + Manager.GetPlayerFull()).setScore(line--);
|
||||
|
||||
@ -1027,6 +1028,7 @@ public class GameLobbyManager implements Listener, IPacketHandler
|
||||
}
|
||||
|
||||
_oldPlayerCount = UtilServer.getPlayers().length;
|
||||
_playerCountKey = UtilServer.getPlayers().length + "/" + Manager.GetPlayerFull();
|
||||
}
|
||||
|
||||
private String GetKitCustomName(Player player, Game game, LobbyEnt ent)
|
||||
|
Loading…
Reference in New Issue
Block a user