mirror of
https://github.com/minetest-mods/drawers.git
synced 2024-11-22 06:33:44 +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)
|
||||
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
|
||||
|
||||
function drawers.get_inv_image(name)
|
||||
|
Loading…
Reference in New Issue
Block a user