mirror of
https://github.com/minetest-mods/drawers.git
synced 2024-11-22 14:43:45 +01:00
Fix infotext is displaying "0 Empty (0% full)"
This commit is contained in:
parent
038a1aef74
commit
0acdd1a48a
@ -31,7 +31,12 @@ function drawers.gen_info_text(basename, count, factor, stack_max)
|
|||||||
-- round the number (float -> int)
|
-- round the number (float -> int)
|
||||||
percent = math.floor(percent + 0.5)
|
percent = math.floor(percent + 0.5)
|
||||||
|
|
||||||
return tostring(count) .. " " .. basename .. " (" .. tostring(percent) .. "% full)"
|
if count == 0 then
|
||||||
|
return basename .. " (" .. tostring(percent) .. "% full)"
|
||||||
|
else
|
||||||
|
return tostring(count) .. " " .. basename .. " (" ..
|
||||||
|
tostring(percent) .. "% full)"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawers.get_inv_image(name)
|
function drawers.get_inv_image(name)
|
||||||
|
Loading…
Reference in New Issue
Block a user