Skip to content

Commit

Permalink
Fix issues in UserListPanel.
Browse files Browse the repository at this point in the history
Remove unnecessary build() call.
Fix issue with nextIndex calculation.
  • Loading branch information
BONNe committed Jan 6, 2019
1 parent d072c04 commit c9adcf2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ else if (this.pageIndex > (this.onlineUsers.size() / MAX_ELEMENTS))
while (playerIndex < ((this.pageIndex + 1) * MAX_ELEMENTS) &&
playerIndex < this.onlineUsers.size())
{
panelBuilder.item(this.createPlayerIcon(this.onlineUsers.get(playerIndex))).build();
panelBuilder.item(this.createPlayerIcon(this.onlineUsers.get(playerIndex)));
playerIndex++;
}

int nextIndex = playerIndex + 9 - (playerIndex % 9);
int nextIndex = playerIndex % MAX_ELEMENTS == 0 ?
MAX_ELEMENTS :
(((playerIndex % MAX_ELEMENTS) - 1) / 9 + 1) * 9;

if (playerIndex > MAX_ELEMENTS)
{
Expand Down

0 comments on commit c9adcf2

Please sign in to comment.