mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-19 00:19:03 +01:00
Fixed old origin logic
This commit is contained in:
parent
df6cea61b2
commit
0b8338d4bc
2 changed files with 5 additions and 5 deletions
|
|
@ -302,9 +302,8 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
}
|
||||
|
||||
async applyEffect(effect, actor) {
|
||||
const actorOrigin = effect.parent?.parent ? effect.parent.parent.uuid : effect.parent.uuid;
|
||||
// Enable an existing effect on the target if it originated from this effect
|
||||
if (effect.transfer) {
|
||||
const existingEffect = actor.effects.find(e => e.origin === effect.uuid);
|
||||
if (existingEffect) {
|
||||
return effect.update(
|
||||
foundry.utils.mergeObject({
|
||||
...effect.constructor.getInitialDuration(),
|
||||
|
|
@ -318,7 +317,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
...effect.toObject(),
|
||||
disabled: false,
|
||||
transfer: false,
|
||||
origin: actorOrigin
|
||||
origin: effect.uuid
|
||||
});
|
||||
await ActiveEffect.implementation.create(effectData, { parent: actor });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
|||
if (isOriginTarget && change.effect.origin) {
|
||||
change.value = change.value.replaceAll(/origin\.@/gi, '@');
|
||||
try {
|
||||
const doc = foundry.utils.fromUuidSync(change.effect.origin);
|
||||
const effect = foundry.utils.fromUuidSync(change.effect.origin);
|
||||
const doc = effect.parent?.parent;
|
||||
if (doc) parseModel = doc;
|
||||
} catch (_) {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue