Unset modifiers of attributes that aren't abilities

This commit is contained in:
Stefan Zermatten
2019-02-20 09:27:37 +02:00
parent aa7a426e9f
commit 665a9d716a
2 changed files with 4 additions and 0 deletions

View File

@@ -119,6 +119,8 @@ function writeAttributes(char) {
}
if (typeof att.mod === 'number'){
op.updateMany.update.$set.mod = att.mod;
} else {
op.updateMany.update.$unset = {mod: 1};
}
return op;
});

View File

@@ -50,10 +50,12 @@ attributeSchema = schema({
type: Number,
optional: true,
},
// The computed value of the attribute
value: {
type: Number,
defaultValue: 0,
},
// The computed modifier, provided the attribute is an ability
mod: {
type: SimpleSchema.Integer,
optional: true,