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

master
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
1 changed files with 6 additions and 1 deletions

View File

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