diff options
author | piernov <piernov@piernov.org> | 2016-05-08 15:31:33 +0200 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2016-05-08 15:31:33 +0200 |
commit | f1677164c3f46785f6d9380b68cdeba58a680404 (patch) | |
tree | 8a51322eb910d2d3eb75d1f633bbf400d050d490 | |
parent | 818a88625577b4422f82af6fda3718b43b84fb6d (diff) | |
download | candybox-f1677164c3f46785f6d9380b68cdeba58a680404.tar.gz candybox-f1677164c3f46785f6d9380b68cdeba58a680404.tar.bz2 candybox-f1677164c3f46785f6d9380b68cdeba58a680404.tar.xz candybox-f1677164c3f46785f6d9380b68cdeba58a680404.zip |
Fix Item deletion in Inventory again
-rw-r--r-- | inc/Inventory.inc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/inc/Inventory.inc b/inc/Inventory.inc index c4096b7..2be48f8 100644 --- a/inc/Inventory.inc +++ b/inc/Inventory.inc @@ -58,10 +58,9 @@ class Inventory { if($nb > 0) { $this->items[$k][0]->consume(); $this->items[$k][1]--; - if($nb <= 0) $this->_removeItem($item); - return array($object[0], $nb-1); } - else $this->_removeItem($item); + if($nb-1 <= 0) $this->_removeItem($item); + return array($object[0], $nb-1); } } return false; |