diff options
Diffstat (limited to 'inc')
-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; |