Fix infotext is displaying "0 Empty (0% full)"

This commit is contained in:
LNJ 2017-04-01 22:30:07 +02:00
parent 038a1aef74
commit 0acdd1a48a
No known key found for this signature in database
GPG Key ID: 69268DBD835B6B0B

@ -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)