diff --git a/rpg-docs/client/views/character/buffs/buffDialog/buffDialog.js b/rpg-docs/client/views/character/buffs/buffDialog/buffDialog.js index 66652ee8..36fbb6e2 100644 --- a/rpg-docs/client/views/character/buffs/buffDialog/buffDialog.js +++ b/rpg-docs/client/views/character/buffs/buffDialog/buffDialog.js @@ -34,7 +34,7 @@ Template.buffDetails.helpers({ if (applierCharacter.name === myName) { var charName = "your " } else { - if (applierCharacter.name[applierCharacter.name.length - 1] === 's') { + if (applierCharacter.name && applierCharacter.name[applierCharacter.name.length - 1] === 's') { var charName = applierCharacter.name + "' "; } else { var charName = applierCharacter.name + "'s "; diff --git a/rpg-docs/client/views/character/inventory/inventory.html b/rpg-docs/client/views/character/inventory/inventory.html index 3f8cf590..cf823d5f 100644 --- a/rpg-docs/client/views/character/inventory/inventory.html +++ b/rpg-docs/client/views/character/inventory/inventory.html @@ -28,16 +28,16 @@
{{> carryCapacityBar}}
- {{#if encumberedBuffs.count}} + {{#if encumberedConditions.count}}
- {{#each encumberedBuffs}} + {{#each condition in encumberedConditions}}
-
+
- {{name}} + {{condition.name}}
diff --git a/rpg-docs/client/views/character/inventory/inventory.js b/rpg-docs/client/views/character/inventory/inventory.js index 5a06a21f..f7f2e1a6 100644 --- a/rpg-docs/client/views/character/inventory/inventory.js +++ b/rpg-docs/client/views/character/inventory/inventory.js @@ -68,9 +68,8 @@ Template.inventory.helpers({ return weight; }, encumberedBuffs: function(){ - return Buffs.find({ + return Conditions.find({ charId: this._id, - type: "inate", name: {$in: [ "Encumbered", "Heavily encumbered", @@ -201,12 +200,10 @@ Template.inventory.events({ element: event.currentTarget.parentElement, }); }, - "click .buff": function(event, instance){ - var buffId = this._id; - var charId = Template.parentData()._id; + "click .condition": function(event, instance){ pushDialogStack({ - template: "buffDialog", - data: {buffId: buffId, charId: charId}, + template: "conditionViewDialogDialog", + data: {condition: this.condition}, element: event.currentTarget, }); }, diff --git a/rpg-docs/lib/methods/conditions.js b/rpg-docs/lib/methods/conditions.js index d0f949c8..e3460087 100644 --- a/rpg-docs/lib/methods/conditions.js +++ b/rpg-docs/lib/methods/conditions.js @@ -77,7 +77,7 @@ Meteor.methods({ var condition = getCondition(conditionName); //remove the buff var buff = _.extend( - {charId: charId, type: "inate"}, condition.buff + {charId: charId}, condition.buff ); Conditions.remove(buff); //dont remove the effects, they get removed automatically through parenting