From 9c43e81e57cebceee5abc2e8897e7cf5631eff5b Mon Sep 17 00:00:00 2001 From: piernov Date: Sun, 8 May 2016 14:58:13 +0200 Subject: Fix Inventory display on page load --- js/shop.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/shop.js b/js/shop.js index 4c04572..a520a38 100644 --- a/js/shop.js +++ b/js/shop.js @@ -17,8 +17,9 @@ function displayShop(ret) { } function displayInventory(items) { - for(var i=0; i < items.length; i++) { - addItem(items[i]); + for(var key in items) { + if(items.hasOwnProperty(key)) + addItem(items[key]); } } -- cgit v1.2.3-70-g09d2