mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Updated from special database update syntax to DataFieldOperators
This commit is contained in:
parent
9553f3387f
commit
cd52aa8f9c
25 changed files with 42 additions and 45 deletions
|
|
@ -87,7 +87,7 @@ export default class DHArmor extends AttachableItem {
|
|||
}
|
||||
await this.parent.deleteEmbeddedDocuments('ActiveEffect', effectIds);
|
||||
changes.system.actions = actionIds.reduce((acc, id) => {
|
||||
acc[`-=${id}`] = null;
|
||||
acc[id] = _del;
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
|
|
|
|||
|
|
@ -230,9 +230,9 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
|
||||
if (changed.system?.actions) {
|
||||
const triggersToRemove = Object.keys(changed.system.actions).reduce((acc, key) => {
|
||||
if (!changed.system.actions[key]) {
|
||||
const strippedKey = key.replace('-=', '');
|
||||
acc.push(...this.actions.get(strippedKey).triggers.map(x => x.trigger));
|
||||
const action = changed.system.actions[key];
|
||||
if (action && Object.keys(action).length === 0) {
|
||||
acc.push(...this.actions.get(key).triggers.map(x => x.trigger));
|
||||
}
|
||||
|
||||
return acc;
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ export default class DHWeapon extends AttachableItem {
|
|||
|
||||
await this.parent.deleteEmbeddedDocuments('ActiveEffect', removedEffectsUpdate);
|
||||
changes.system.actions = removedActionsUpdate.reduce((acc, id) => {
|
||||
acc[`-=${id}`] = null;
|
||||
acc[id] = _del;
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue