mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
parent
2d20fb0df4
commit
f76515eac1
5 changed files with 15 additions and 8 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