Skip to content

Commit

Permalink
Fix loop lists
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggi committed Sep 30, 2016
1 parent 9162d58 commit 7220ee3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mselect.inc
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ static stock TD_SetPage(playerid, &page_id, items_array[], items_count, bool:lis
}
}

static stock GetPaginatorInfo(items_count, &curr_page = 0, &max_page = 0, &start_index = 0, &end_index = 0, list_loop = false)
static stock GetPaginatorInfo(items_count, &curr_page = 0, &max_page = 0, &start_index = 0, &end_index = 0, bool:list_loop = false)
{
if (items_count <= 0) {
return;
Expand Down Expand Up @@ -606,7 +606,7 @@ public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
}

// check paginator
if (TD_ButtonPrev[playerid] == playertextid && ListPage[playerid] != 0) {
if (TD_ButtonPrev[playerid] == playertextid && (ListLoop[playerid] || ListPage[playerid] != 0)) {
ListPage[playerid]--;
TD_SetPage(playerid, ListPage[playerid], TD_ItemsModel[playerid], ItemsCount[playerid],
ListLoop[playerid], TD_PosX[playerid], TD_PosY[playerid],
Expand All @@ -621,7 +621,7 @@ public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
new max_page;
GetPaginatorInfo(ItemsCount[playerid], .max_page = max_page);

if (TD_ButtonNext[playerid] == playertextid && ListPage[playerid] != max_page - 1) {
if (TD_ButtonNext[playerid] == playertextid && (ListLoop[playerid] || ListPage[playerid] != max_page - 1)) {
ListPage[playerid]++;
TD_SetPage(playerid, ListPage[playerid], TD_ItemsModel[playerid], ItemsCount[playerid],
ListLoop[playerid], TD_PosX[playerid], TD_PosY[playerid],
Expand Down

0 comments on commit 7220ee3

Please sign in to comment.