From 92d3b086fa2c090a076e3cb285343bd568facf66 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Thu, 23 Jul 2015 09:14:55 +0200 Subject: [PATCH] net worth calculations now take into account your containers' values --- rpg-docs/client/views/character/inventory/inventory.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpg-docs/client/views/character/inventory/inventory.js b/rpg-docs/client/views/character/inventory/inventory.js index 58e70ea2..cde203fa 100644 --- a/rpg-docs/client/views/character/inventory/inventory.js +++ b/rpg-docs/client/views/character/inventory/inventory.js @@ -44,6 +44,12 @@ Template.inventory.helpers({ ).forEach(function(item){ worth += item.totalValue(); }); + Containers.find( + {charId: this._id}, + {fields: {value : 1}} + ).forEach(function(container) { + if(container.value) worth += container.value; + }) return worth; }, weightCarried: function(){