Fix bug: not removing items from stack if drawer is nearly full

This commit is contained in:
LNJ 2017-04-01 20:22:38 +02:00
parent 42206a1eca
commit 1862ddbef3
No known key found for this signature in database
GPG Key ID: 69268DBD835B6B0B

@ -188,8 +188,8 @@ core.register_entity("drawers:visual", {
-- set new counts: -- set new counts:
-- if new count is more than max_count -- if new count is more than max_count
if (self.count + stackCount) > self.maxCount then if (self.count + stackCount) > self.maxCount then
itemstack:set_count(self.count + stackCount - self.maxCount)
self.count = self.maxCount self.count = self.maxCount
itemstack:set_count((self.count + stackCount) - self.maxCount)
else -- new count fits else -- new count fits
self.count = self.count + stackCount self.count = self.count + stackCount
-- this is for only removing one -- this is for only removing one