Skip to content

Commit

Permalink
Fix infotext is displaying "0 Empty (0% full)"
Browse files Browse the repository at this point in the history
  • Loading branch information
LNJ committed Apr 1, 2017
1 parent 038a1ae commit 0acdd1a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0acdd1a

Please sign in to comment.