mirror of
https://github.com/mt-mods/dreambuilder_hotbar.git
synced 2024-07-04 14:55:22 +02:00
round the given size to the nearest integer
This commit is contained in:
parent
a39515afaf
commit
d521b6f1dc
2
init.lua
2
init.lua
@ -9,7 +9,7 @@ end
|
||||
|
||||
local function validate_size(s)
|
||||
local size = s and tonumber(s) or 16
|
||||
return math.max(1, math.min(size, 32))
|
||||
return math.floor(0.5 + math.max(1, math.min(size, 32)))
|
||||
end
|
||||
|
||||
local hotbar_size_default = validate_size(minetest.settings:get("hotbar_size"))
|
||||
|
Loading…
Reference in New Issue
Block a user