net worth calculations now take into account your containers' values

This commit is contained in:
Stefan Zermatten
2015-07-23 09:14:55 +02:00
parent d7852d640f
commit 92d3b086fa

View File

@@ -44,6 +44,12 @@ Template.inventory.helpers({
).forEach(function(item){ ).forEach(function(item){
worth += item.totalValue(); worth += item.totalValue();
}); });
Containers.find(
{charId: this._id},
{fields: {value : 1}}
).forEach(function(container) {
if(container.value) worth += container.value;
})
return worth; return worth;
}, },
weightCarried: function(){ weightCarried: function(){