Skip to content

Commit

Permalink
Merge pull request #259 from MrPrimate/reduce-times-up-expire
Browse files Browse the repository at this point in the history
Reduce times up expire
  • Loading branch information
MrPrimate authored Dec 28, 2022
2 parents 00e02c7 + 0dbf8a1 commit 2ecf75a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,7 @@ Correct a missing deprecated data reference.
Try and prevent the double effect deletion.
HP Check could misfire effect application due to bad HP logic.
Auras in 5e will support the `isSuppressed` flag, and triggered by attunement and equipped status if it's an item. (@DarkByteZero)

# 0.5.4

Don't trigger effect removal when times-up expires an effect as it cleans up for us.
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/kandashi/Active-Auras",
"bugs": "https://github.com/kandashi/Active-Auras/issues",
"flags": {},
"version": "0.5.3",
"version": "0.5.4",
"compatibility": {
"minimum": 10,
"verified": 10
Expand Down
10 changes: 6 additions & 4 deletions src/AAhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,12 @@ Hooks.on("updateActiveEffect", (effect, _update) => {
Hooks.on("deleteActiveEffect", (effect, options) => {
if (canvas.scene === null) { if (AAdebug) { console.log("Active Auras disabled due to no canvas") } return }
if (!AAgm) return;
let applyStatus = effect.flags?.ActiveAuras?.applied;
let auraStatus = effect.flags?.ActiveAuras?.isAura;
if (!applyStatus && auraStatus) {
if (AAdebug) console.log("deleteActiveEffect, collate auras true false", { effect, update: options });
const applyStatus = effect.flags?.ActiveAuras?.applied;
const auraStatus = effect.flags?.ActiveAuras?.isAura;
const timeUpExpiry = options["expiry-reason"]?.startsWith("times-up:");

if (!applyStatus && auraStatus && !timeUpExpiry) {
if (AAdebug) console.log("deleteActiveEffect, collate auras true false", { effect, options });
debouncedCollate(canvas.scene.id, false, true, "deleteActiveEffect");
}
});
Expand Down

0 comments on commit 2ecf75a

Please sign in to comment.