Fix my fix for scoreboard - mine broke when new players joined
This commit is contained in:
parent
4b4ebd0e36
commit
eb0f23318f
@ -108,7 +108,7 @@ public class GameLobbyManager implements Listener, IPacketHandler
|
|||||||
private NautHashMap<Player, String> _kitMap = new NautHashMap<Player, String>();
|
private NautHashMap<Player, String> _kitMap = new NautHashMap<Player, String>();
|
||||||
|
|
||||||
private int _oldPlayerCount = 0;
|
private int _oldPlayerCount = 0;
|
||||||
private String _playerCountKey = ""; // Used for scoreboard when max player count changes
|
private int _oldMaxPlayerCount = 0; // Used for scoreboard when max player count changes
|
||||||
|
|
||||||
private boolean _handlingPacket = false;
|
private boolean _handlingPacket = false;
|
||||||
|
|
||||||
@ -967,7 +967,7 @@ public class GameLobbyManager implements Listener, IPacketHandler
|
|||||||
objective.getScore(C.cYellow + "Players").setScore(line--);
|
objective.getScore(C.cYellow + "Players").setScore(line--);
|
||||||
|
|
||||||
// Remove Old
|
// Remove Old
|
||||||
entry.getValue().resetScores(_playerCountKey);
|
entry.getValue().resetScores(_oldPlayerCount + "/" + _oldMaxPlayerCount);
|
||||||
// Set new
|
// Set new
|
||||||
objective.getScore(UtilServer.getPlayers().length + "/" + Manager.GetPlayerFull()).setScore(line--);
|
objective.getScore(UtilServer.getPlayers().length + "/" + Manager.GetPlayerFull()).setScore(line--);
|
||||||
|
|
||||||
@ -1028,7 +1028,7 @@ public class GameLobbyManager implements Listener, IPacketHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
_oldPlayerCount = UtilServer.getPlayers().length;
|
_oldPlayerCount = UtilServer.getPlayers().length;
|
||||||
_playerCountKey = UtilServer.getPlayers().length + "/" + Manager.GetPlayerFull();
|
_oldMaxPlayerCount = Manager.GetPlayerFull();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String GetKitCustomName(Player player, Game game, LobbyEnt ent)
|
private String GetKitCustomName(Player player, Game game, LobbyEnt ent)
|
||||||
|
Loading…
Reference in New Issue
Block a user