Skip to content

Commit

Permalink
0.5.45
Browse files Browse the repository at this point in the history
  • Loading branch information
gambit07 committed Sep 16, 2024
1 parent 3a9fbbd commit 47a715c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id: set-release-notes-github
run: |
echo "- Bugfixes:" >> release_notes.txt
echo " - Mirrored 3rd Party Dialog: Fix a socket logic issue when the caster of a spell was also the user of the corresponding reaction." >> release_notes.txt
echo " - General: Added some additional handling for invalid tokens on a scene for 3rd party reactions." >> release_notes.txt
echo "release-notes-github<<EOF" >> $GITHUB_ENV
cat release_notes.txt >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
Expand Down
14 changes: 7 additions & 7 deletions scripts/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,20 +225,20 @@ export function findValidTokens({initiatingToken, targetedToken, itemName, itemT
}

function filterToken(t) {
let checkItem = t?.actor?.items?.find(i => i.name.toLowerCase() === itemName);
const effectNamesOrigin = ["Confusion", "Arms of Hadar", "Shocking Grasp", "Slow", "Staggering Smite"];
let hasEffectOrigin = t.actor.appliedEffects.some(effect => effectNamesOrigin.includes(effect.name));
let measuredDistance = (dispositionCheckType === "ally" || dispositionCheckType === "enemyAlly") ? MidiQOL.computeDistance(targetedToken,t,true) : MidiQOL.computeDistance(initiatingToken,t,true);
let range = game.gps.convertFromFeet({range: rangeTotal});

// Check if invalid token on the canvas
if (!t.actor) {
if(debugEnabled) console.error(`${itemName} for ${t.actor ? t.actor.name : "Unknown Actor"} failed at invalid token actor on canvas`);
return;
}

let checkItem = t?.actor?.items?.find(i => i.name.toLowerCase() === itemName);
const effectNamesOrigin = ["Confusion", "Arms of Hadar", "Shocking Grasp", "Slow", "Staggering Smite"];
let hasEffectOrigin = t?.actor?.appliedEffects.some(effect => effectNamesOrigin.includes(effect.name));
let measuredDistance = (dispositionCheckType === "ally" || dispositionCheckType === "enemyAlly") ? MidiQOL.computeDistance(targetedToken,t,true) : MidiQOL.computeDistance(initiatingToken,t,true);
let range = game.gps.convertFromFeet({range: rangeTotal});

// Check if the token has the actual item to use
else if(!checkItem) {
if(!checkItem) {
if(debugEnabled) console.error(`${itemName} for ${t.actor.name} failed at check if reaction item exists`);
return;
}
Expand Down

0 comments on commit 47a715c

Please sign in to comment.