aboutsummaryrefslogtreecommitdiffstats
path: root/inc/shop.inc
diff options
context:
space:
mode:
authoralexichi <alexbankai96@gmail.com>2016-04-29 21:06:59 +0200
committeralexichi <alexbankai96@gmail.com>2016-04-29 21:06:59 +0200
commit48ca3e8ee63787d567fd0fe1bcfea7158a6f9596 (patch)
tree2c2b5bdf4c2461444112c5a63b94f4dffcae84ff /inc/shop.inc
parent3c297defe63a2af75cc7aafcfa5cf74dd1f2c20a (diff)
downloadcandybox-48ca3e8ee63787d567fd0fe1bcfea7158a6f9596.tar.gz
candybox-48ca3e8ee63787d567fd0fe1bcfea7158a6f9596.tar.bz2
candybox-48ca3e8ee63787d567fd0fe1bcfea7158a6f9596.tar.xz
candybox-48ca3e8ee63787d567fd0fe1bcfea7158a6f9596.zip
add the option to not create 2 objects of the same type, doesn't work well
Diffstat (limited to 'inc/shop.inc')
-rw-r--r--inc/shop.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/shop.inc b/inc/shop.inc
index 6e30923..83b08b0 100644
--- a/inc/shop.inc
+++ b/inc/shop.inc
@@ -56,8 +56,8 @@ function buildShop() {
function buyItem() {
$item = getItem($_POST["item"]);
if($item && debitAccount($item->cost)) {
- Inventory::addItem($item);
- echo json_encode($item);
+ $tab = Inventory::addItem($item);
+ echo json_encode($tab); //renvoyer un tableau avec comme première entrée $item et comme deuxième entrée le nombre
}
}