mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-12-13 18:20:17 +01:00
Small simplification
This commit is contained in:
parent
c129894942
commit
cf51f9defa
2
init.lua
2
init.lua
@ -17,7 +17,7 @@ end
|
|||||||
function craftguide:get_formspec(stack, pagenum, item, recipe_num, filter, player_name)
|
function craftguide:get_formspec(stack, pagenum, item, recipe_num, filter, player_name)
|
||||||
local inv_size = datas[player_name].size
|
local inv_size = datas[player_name].size
|
||||||
local npp, i, s = 8*3, 0, 0
|
local npp, i, s = 8*3, 0, 0
|
||||||
local pagemax = math.floor((inv_size - 1) / npp + 1)
|
local pagemax = math.ceil(inv_size / npp)
|
||||||
|
|
||||||
if pagenum > pagemax then pagenum = 1
|
if pagenum > pagemax then pagenum = 1
|
||||||
elseif pagenum == 0 then pagenum = pagemax end
|
elseif pagenum == 0 then pagenum = pagemax end
|
||||||
|
Loading…
Reference in New Issue
Block a user