From 4a25c22b646373425c1fb0cf3249cb42f0a1ee45 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Fri, 6 Mar 2020 10:02:39 +0200 Subject: [PATCH] Fixed spell and resource card adjustments --- app/imports/api/creature/CreatureProperties.js | 3 ++- app/imports/ui/properties/attributes/ResourceCard.vue | 2 +- app/imports/ui/properties/attributes/SpellSlotListTile.vue | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/imports/api/creature/CreatureProperties.js b/app/imports/api/creature/CreatureProperties.js index 0a3300d7..a87d96b9 100644 --- a/app/imports/api/creature/CreatureProperties.js +++ b/app/imports/api/creature/CreatureProperties.js @@ -155,7 +155,8 @@ const updateProperty = new ValidatedMethod({ case 'parent': case 'ancestors': case 'damage': - return false; + throw new Meteor.Error('Permission denied', + 'This property can\'t be updated directly'); } }, run({_id, path, value}) { diff --git a/app/imports/ui/properties/attributes/ResourceCard.vue b/app/imports/ui/properties/attributes/ResourceCard.vue index dd337376..120c8330 100644 --- a/app/imports/ui/properties/attributes/ResourceCard.vue +++ b/app/imports/ui/properties/attributes/ResourceCard.vue @@ -37,7 +37,7 @@ name: String, color: String, value: Number, - adjustment: Number, + damage: Number, }, computed: { currentValue(){ diff --git a/app/imports/ui/properties/attributes/SpellSlotListTile.vue b/app/imports/ui/properties/attributes/SpellSlotListTile.vue index f6912a76..4f96f2b7 100644 --- a/app/imports/ui/properties/attributes/SpellSlotListTile.vue +++ b/app/imports/ui/properties/attributes/SpellSlotListTile.vue @@ -61,14 +61,14 @@ export default { name: String, color: String, value: Number, - adjustment: { + damage: { type: Number, default: 0, }, }, computed: { currentValue(){ - return this.value + (this.adjustment || 0); + return this.value - this.damage; }, }, methods: {