From 1862ddbef367dd1fd43cc7feb051e0b043e979ba Mon Sep 17 00:00:00 2001 From: LNJ Date: Sat, 1 Apr 2017 20:22:38 +0200 Subject: [PATCH] Fix bug: not removing items from stack if drawer is nearly full --- lua/visual.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/visual.lua b/lua/visual.lua index 8f99e5e..61b02a3 100755 --- a/lua/visual.lua +++ b/lua/visual.lua @@ -188,8 +188,8 @@ core.register_entity("drawers:visual", { -- set new counts: -- if new count is more than max_count if (self.count + stackCount) > self.maxCount then + itemstack:set_count(self.count + stackCount - self.maxCount) self.count = self.maxCount - itemstack:set_count((self.count + stackCount) - self.maxCount) else -- new count fits self.count = self.count + stackCount -- this is for only removing one