Check number of pages when next/prev clicked

This commit is contained in:
Paul Ouellette 2019-01-19 20:38:10 -05:00
parent 159fc89155
commit 1e49c065f2
1 changed files with 4 additions and 0 deletions

View File

@ -650,6 +650,10 @@ local function on_receive_fields(player, fields)
show_fs(player, player_name)
elseif fields.prev or fields.next then
if data.pagemax == 1 then
return
end
data.pagenum = data.pagenum - (fields.prev and 1 or -1)
if data.pagenum > data.pagemax then
data.pagenum = 1