diff options
author | alexichi <alexbankai96@gmail.com> | 2016-05-02 14:51:37 +0200 |
---|---|---|
committer | alexichi <alexbankai96@gmail.com> | 2016-05-02 14:51:37 +0200 |
commit | 556adda68fe99e3a88f59803aa9bd8892e4d34cf (patch) | |
tree | 2de7c76ad8c4c0cdfde7086c3cb179f44a665fbc /inc | |
parent | 64b1663e55544e1ed0e072c4f624688625691c9f (diff) | |
download | candybox-556adda68fe99e3a88f59803aa9bd8892e4d34cf.tar.gz candybox-556adda68fe99e3a88f59803aa9bd8892e4d34cf.tar.bz2 candybox-556adda68fe99e3a88f59803aa9bd8892e4d34cf.tar.xz candybox-556adda68fe99e3a88f59803aa9bd8892e4d34cf.zip |
fix shop item count
Diffstat (limited to 'inc')
-rw-r--r-- | inc/Inventory.inc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/Inventory.inc b/inc/Inventory.inc index 3396eb9..20c63bf 100644 --- a/inc/Inventory.inc +++ b/inc/Inventory.inc @@ -20,13 +20,13 @@ class Inventory { } private function _addItem($item) { - $counter = 0; - foreach($this->items as $object){ + foreach($this->items as $k => $object){ if($object[0] == $item){ - $counter++; + $this->items[$k][1]++; + return $this->items[$k]; } } - $tab = array($item,$counter+1); + $tab = array($item,1); $this->items[] = $tab; return $tab; } |