mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 16:09:03 +01:00
Added migration for existing actor features
This commit is contained in:
parent
9b332c3681
commit
672a7dd999
3 changed files with 35 additions and 3 deletions
|
|
@ -102,6 +102,15 @@ export default class DHClass extends BaseDataItem {
|
|||
if (allowed === false) return;
|
||||
}
|
||||
|
||||
_onDelete(options, userId) {
|
||||
super._onDelete(options, userId);
|
||||
|
||||
if (options.parent?.type === 'character') {
|
||||
const path = `system.${this.isMulticlass ? 'multiclass' : 'class'}`;
|
||||
foundry.utils.getProperty(options.parent, `${path}.subclass`)?.delete();
|
||||
}
|
||||
}
|
||||
|
||||
async _preUpdate(changed, options, userId) {
|
||||
const allowed = await super._preUpdate(changed, options, userId);
|
||||
if (allowed === false) return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue