Skip to content

Commit

Permalink
Merge pull request #41 from kandashi/0.1.25
Browse files Browse the repository at this point in the history
null actor removal
  • Loading branch information
kandashi authored Jan 18, 2021
2 parents 004c9c1 + 0c3927a commit 610df04
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "Active-Auras",
"description": "Active-Auras",
"author": "Kandashi",
"version": "0.1.24",
"version": "0.1.25",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.9",
"packs": [
Expand Down
22 changes: 13 additions & 9 deletions src/aura.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ Hooks.on("ready", () => {
</select>
</div>
</div>`;
html.find(".tabs .item").last().after(tab);
html.find(".tab").last().after(contents);
html.find(".tabs .item").last().after(tab);
html.find(".tab").last().after(contents);
});

let AuraMap = new Map()
Expand Down Expand Up @@ -202,11 +202,13 @@ Hooks.on("ready", () => {
}
if (checkAuras) {
setTimeout(() => {
MainAura()}, 20)
MainAura()
}, 20)
}
if (removeAuras) {
setTimeout(() => {
RemoveAppliedAuras(canvas)}, 20)
RemoveAppliedAuras(canvas)
}, 20)
}
}

Expand All @@ -231,7 +233,7 @@ Hooks.on("ready", () => {
function MainAura(movedToken) {
let gm = game.user === game.users.find((u) => u.isGM && u.active)
if (!gm) return;

let map = new Map();

UpdateAllTokens(map, canvas.tokens.placeables)
Expand Down Expand Up @@ -381,11 +383,13 @@ Hooks.on("ready", () => {
* @param {String} effectLabel - label of effect to remove
*/
function RemoveActiveEffects(token, effectLabel) {
for (let tokenEffects of token.actor.effects) {
if (tokenEffects.data.label === effectLabel && tokenEffects.data.flags?.ActiveAuras.applied === true) {
tokenEffects.delete()
console.log(game.i18n.format("ACTIVEAURAS.RemoveLog", { effectDataLabel: effectLabel, tokenName: token.name }))
if (removeToken?.actor?.effects) {
for (let tokenEffects of token.actor.effects) {
if (tokenEffects.data.label === effectLabel && tokenEffects.data.flags?.ActiveAuras.applied === true) {
tokenEffects.delete()
console.log(game.i18n.format("ACTIVEAURAS.RemoveLog", { effectDataLabel: effectLabel, tokenName: token.name }))

}
}
}
}
Expand Down

0 comments on commit 610df04

Please sign in to comment.