Fix scoreboard out of bounds error
This commit is contained in:
parent
6e90052480
commit
1a2c163ce2
@ -113,11 +113,6 @@ public class SpectatorPage extends
|
|||||||
|
|
||||||
private void buildMultipleTeams(List<GameTeam> teamList, int playerCount)
|
private void buildMultipleTeams(List<GameTeam> teamList, int playerCount)
|
||||||
{
|
{
|
||||||
_buttons = new IButton[0];
|
|
||||||
_items = new ItemStack[0];
|
|
||||||
|
|
||||||
int currentRow = 0;
|
|
||||||
|
|
||||||
Collections.sort(teamList, new Comparator<GameTeam>()
|
Collections.sort(teamList, new Comparator<GameTeam>()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -138,6 +133,11 @@ public class SpectatorPage extends
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
_buttons = new IButton[0];
|
||||||
|
_items = new ItemStack[0];
|
||||||
|
|
||||||
|
int currentRow = 0;
|
||||||
|
|
||||||
for (GameTeam team : teamList)
|
for (GameTeam team : teamList)
|
||||||
{
|
{
|
||||||
ArrayList<Player> teamPlayers = team.GetPlayers(true);
|
ArrayList<Player> teamPlayers = team.GetPlayers(true);
|
||||||
@ -155,7 +155,7 @@ public class SpectatorPage extends
|
|||||||
|
|
||||||
_buttons = Arrays.copyOf(_buttons, _buttons.length
|
_buttons = Arrays.copyOf(_buttons, _buttons.length
|
||||||
+ (rowsNeeded * 9));
|
+ (rowsNeeded * 9));
|
||||||
_items = Arrays.copyOf(_items, _items.length + (rowsNeeded * 9));
|
_items = Arrays.copyOf(_items, _items.length + (rowsNeeded * 9) + rowsNeeded);
|
||||||
|
|
||||||
for (int row = 0; row < rowsNeeded; row++)
|
for (int row = 0; row < rowsNeeded; row++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user