aboutsummaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-08 15:31:33 +0200
committerpiernov <piernov@piernov.org>2016-05-08 15:31:33 +0200
commitf1677164c3f46785f6d9380b68cdeba58a680404 (patch)
tree8a51322eb910d2d3eb75d1f633bbf400d050d490 /inc
parent818a88625577b4422f82af6fda3718b43b84fb6d (diff)
downloadcandybox-f1677164c3f46785f6d9380b68cdeba58a680404.tar.gz
candybox-f1677164c3f46785f6d9380b68cdeba58a680404.tar.bz2
candybox-f1677164c3f46785f6d9380b68cdeba58a680404.tar.xz
candybox-f1677164c3f46785f6d9380b68cdeba58a680404.zip
Fix Item deletion in Inventory again
Diffstat (limited to 'inc')
-rw-r--r--inc/Inventory.inc5
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;