Skip to content

Commit

Permalink
Merge pull request #681 from dmrickey/PF1-customized-active-effect
Browse files Browse the repository at this point in the history
Fixed active effect creation in pf1
  • Loading branch information
otigon authored Sep 3, 2023
2 parents 170ced1 + 2c7d15e commit 33f7e1d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/active-effects/handleActiveEffectHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,27 @@ export function registerActiveEffectHooks() {
toggleActiveEffects(data, toggle)
});
case "pf1":
Hooks.on("createActiveEffect", async (effect, data, userId) => {
if (game.settings.get("autoanimations", "disableAEAnimations")) {
debug(`Active Effect Animations are Disabled`);
return;
}
if (game.user.id !== userId) { return; }
const item = fromUuidSync(effect.origin);
if (item) {
const flagData = fromUuidSync(effect.origin).flags['autoanimations'];
if (flagData) {
await effect.update({ 'flags.autoanimations': flagData });
}
createActiveEffects(effect);
}
});
Hooks.on("preDeleteActiveEffect", (effect, data, userId) => {
if (game.user.id !== userId) { return; }

deleteActiveEffects(effect);
});
break;
case 'wfrp4e':
Hooks.on("createActiveEffect", (effect, data, userId) => {
if (game.settings.get("autoanimations", "disableAEAnimations")) {
Expand Down

0 comments on commit 33f7e1d

Please sign in to comment.