From 48ca3e8ee63787d567fd0fe1bcfea7158a6f9596 Mon Sep 17 00:00:00 2001 From: alexichi Date: Fri, 29 Apr 2016 21:06:59 +0200 Subject: add the option to not create 2 objects of the same type, doesn't work well --- inc/shop.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/shop.inc') 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 } } -- cgit v1.2.3-70-g09d2