summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLNJ <git@lnj.li>2017-04-01 20:22:38 +0200
committerLNJ <git@lnj.li>2017-04-01 20:22:38 +0200
commit1862ddbef367dd1fd43cc7feb051e0b043e979ba (patch)
treed3092e29cc60430ae2c53f9a947cff347ee9ef24
parent42206a1eca3991f3efed2c4c138d4e033a64c759 (diff)
Fix bug: not removing items from stack if drawer is nearly full
-rwxr-xr-xlua/visual.lua2
1 files changed, 1 insertions, 1 deletions
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