From f1677164c3f46785f6d9380b68cdeba58a680404 Mon Sep 17 00:00:00 2001 From: piernov Date: Sun, 8 May 2016 15:31:33 +0200 Subject: Fix Item deletion in Inventory again --- inc/Inventory.inc | 5 ++--- 1 file 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; -- cgit v1.2.3-54-g00ecf