Fix scoreboard out of bounds error

This commit is contained in:
libraryaddict 2015-11-11 00:03:08 +13:00
parent 6e90052480
commit 1a2c163ce2

View File

@ -113,11 +113,6 @@ public class SpectatorPage extends
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>()
{
@ -138,6 +133,11 @@ public class SpectatorPage extends
});
_buttons = new IButton[0];
_items = new ItemStack[0];
int currentRow = 0;
for (GameTeam team : teamList)
{
ArrayList<Player> teamPlayers = team.GetPlayers(true);
@ -155,7 +155,7 @@ public class SpectatorPage extends
_buttons = Arrays.copyOf(_buttons, _buttons.length
+ (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++)
{