From 0acdd1a48a4a41f27fde7313951660396e54e39b Mon Sep 17 00:00:00 2001 From: LNJ Date: Sat, 1 Apr 2017 22:30:07 +0200 Subject: [PATCH] Fix infotext is displaying "0 Empty (0% full)" --- lua/helpers.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/helpers.lua b/lua/helpers.lua index 173a472..3718da3 100755 --- a/lua/helpers.lua +++ b/lua/helpers.lua @@ -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)