mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 07:36:26 +01:00
change flags
This commit is contained in:
parent
896f317c6d
commit
fbe551624d
4 changed files with 6 additions and 4 deletions
0
module/applications/sheets/api/item-attachment-sheet.mjs
Normal file
0
module/applications/sheets/api/item-attachment-sheet.mjs
Normal file
|
|
@ -7,3 +7,5 @@ export const encounterCountdown = {
|
|||
simple: 'countdown-encounter-simple',
|
||||
position: 'countdown-encounter-position'
|
||||
};
|
||||
|
||||
export const itemAttachmentSource = 'attachmentSource';
|
||||
0
module/data/item/attachableItem.mjs
Normal file
0
module/data/item/attachableItem.mjs
Normal file
|
|
@ -32,9 +32,9 @@ export async function copyAttachmentEffectsToActor({ parentItem, attachedItem, a
|
|||
|
||||
effectData.flags = {
|
||||
...effectData.flags,
|
||||
daggerheart: {
|
||||
...effectData.flags?.daggerheart,
|
||||
attachmentSource
|
||||
[CONFIG.DH.id]: {
|
||||
...effectData.flags?.[CONFIG.DH.id],
|
||||
[CONFIG.DH.FLAGS.itemAttachmentSource]: attachmentSource
|
||||
}
|
||||
};
|
||||
effectsToCreate.push(effectData);
|
||||
|
|
@ -61,7 +61,7 @@ export async function removeAttachmentEffectsFromActor({ parentItem, attachedUui
|
|||
|
||||
const parentUuidProperty = `${parentType}Uuid`;
|
||||
const effectsToRemove = actor.effects.filter(effect => {
|
||||
const attachmentSource = effect.flags?.daggerheart?.attachmentSource;
|
||||
const attachmentSource = effect.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.itemAttachmentSource);
|
||||
return attachmentSource &&
|
||||
attachmentSource[parentUuidProperty] === parentItem.uuid &&
|
||||
attachmentSource.itemUuid === attachedUuid;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue