Skip to content

Commit

Permalink
Corrected equipment effect suppression logic
Browse files Browse the repository at this point in the history
In determineSuppression logic, changed requirement for source to be Actor, to source NOT being actor; should now process item-based effects only, instead of only non-item effects. (Fixes #387).
  • Loading branch information
FoxLee authored Oct 28, 2024
1 parent e18c324 commit 6e82e3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions module/effects/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
// const updates = {duration: {startTime: game.time.worldTime}, transfer: false, equippedRec: false};
updates.duration = {startTime: game.time.worldTime};
updates.transfer = false;
updates.equippedRec = false
updates.equippedRec = false;

const combat = game.combat;
if (combat?.turn != null && combat.turns && combat.turns[combat.turn]) {//if combat has started - combat.turn for the first character = 0 (so cannot use truthy value). If there are no combatents combat.turns = []
Expand All @@ -135,14 +135,14 @@
*/
determineSuppression() {
this.isSuppressed = false;

const originArray = this.origin?.split(".");
if ( this.disabled || !originArray || originArray[0] !== "Actor" || originArray.indexOf("Item") < 0 ) return;

if ( this.disabled || !originArray || originArray[0] == "Actor" || originArray.indexOf("Item") < 0 ) return;

const item = this.parent;
if ( !item ) return;

//types of items that can be equipted
//types of items that can be equipped
const validTypes = ["weapon", "equipment", "tool", "loot", "backpack"];
if(validTypes.includes(item.type) && item.system.equipped === false){
this.isSuppressed = this.flags.dnd4e?.effectData?.equippedRec || false;
Expand Down

0 comments on commit 6e82e3f

Please sign in to comment.