Fixed spell and resource card adjustments

This commit is contained in:
Stefan Zermatten
2020-03-06 10:02:39 +02:00
parent 53e9be1407
commit 4a25c22b64
3 changed files with 5 additions and 4 deletions

View File

@@ -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}) {

View File

@@ -37,7 +37,7 @@
name: String,
color: String,
value: Number,
adjustment: Number,
damage: Number,
},
computed: {
currentValue(){

View File

@@ -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: {