Fixes #127. Also fixes it for other ammo as well as iron spikes

This commit is contained in:
Jacob
2017-09-04 15:14:35 +01:00
parent 06ac9f70c8
commit 15d797131e
5 changed files with 56 additions and 24 deletions

View File

@@ -107,3 +107,24 @@ Template.itemLibraryDialog.events({
template.searchTerm.set(value);
},
});
Template.libraryItem.helpers({
itemName: function(){
return this.item.libraryName || this.item.name;
},
itemWeight: function(){
if (this.item.quantity) {
return this.item.weight * this.item.quantity;
} else {
return this.item.weight;
}
},
itemValue: function(){
if (this.item.quantity) {
return this.item.value * this.item.quantity;
} else {
return this.item.value;
}
},
});