Fixed normal levelup

This commit is contained in:
WBHarry 2025-06-30 13:43:12 +02:00
parent 0aa08deaa3
commit b18f072c64
14 changed files with 159 additions and 104 deletions

View file

@ -115,7 +115,7 @@ export default class DhCharacter extends BaseDataActor {
magic: new fields.NumberField({ integer: true, initial: 0 })
})
}),
companion: new ForeignDocumentUUIDField({ type: 'actor', nullable: true, initial: null }),
companion: new ForeignDocumentUUIDField({ type: 'Actor', nullable: true, initial: null }),
rules: new fields.SchemaField({
maxArmorMarked: new fields.SchemaField({
value: new fields.NumberField({ required: true, integer: true, initial: 1 }),
@ -315,4 +315,10 @@ export default class DhCharacter extends BaseDataActor {
level: this.levelData.level.current
};
}
async _preDelete() {
if (this.companion) {
this.companion.updateLevel(1);
}
}
}