mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Fixed weapons
This commit is contained in:
parent
286944d2e6
commit
ee89d5cb9e
5 changed files with 115 additions and 56 deletions
|
|
@ -226,5 +226,11 @@ export default class DHItem extends foundry.documents.Item {
|
|||
|
||||
async _preDelete() {
|
||||
this.deleteTriggers();
|
||||
|
||||
if (this.parent?.type === 'character') {
|
||||
const filteredFavorites = this.parent.system.sidebarFavorites.filter(x => x.id !== this.id);
|
||||
if (this.parent.system.sidebarFavorites.length !== filteredFavorites.length)
|
||||
this.parent.update({ 'system.sidebarFavorites': filteredFavorites });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue