aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-08 14:58:13 +0200
committerpiernov <piernov@piernov.org>2016-05-08 14:58:13 +0200
commit9c43e81e57cebceee5abc2e8897e7cf5631eff5b (patch)
treeb7214a58a4742f4940657b3672723cb8bf4ed4f4 /js
parent44fea0c94df8f61ac1f31b8506cca0346e41bac9 (diff)
downloadcandybox-9c43e81e57cebceee5abc2e8897e7cf5631eff5b.tar.gz
candybox-9c43e81e57cebceee5abc2e8897e7cf5631eff5b.tar.bz2
candybox-9c43e81e57cebceee5abc2e8897e7cf5631eff5b.tar.xz
candybox-9c43e81e57cebceee5abc2e8897e7cf5631eff5b.zip
Fix Inventory display on page load
Diffstat (limited to 'js')
-rw-r--r--js/shop.js5
1 files 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]);
}
}