fix: use arcane spell defense D30 chart for spell saves
Release Creation / build (release) Successful in 43s
Release Creation / build (release) Successful in 43s
Bug: saveSpell local var initialized to false (line 142), while dialog checkbox was pre-checked via dialogContext.saveSpell = game.lethalFantasy.spellDefense. If user didn't click the checkbox, D30 call used SAVING_THROWS chart instead of ARCANE_SPELL_DEFENSE. Also: game.lethalFantasy.spellDefense was set true before spell defense rolls but never cleared, leaking to subsequent non-spell saves. Fix: initialize saveSpell from the one-shot flag and delete it immediately. Dialog context now uses the local saveSpell variable instead of re-reading the deleted flag.
This commit is contained in:
@@ -139,7 +139,9 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let hasGrantedDice = false
|
||||
let pointBlank = false
|
||||
let letItFly = false
|
||||
let saveSpell = false
|
||||
let saveSpell = game.lethalFantasy?.spellDefense ?? false
|
||||
// Consume one-shot flag so it doesn't leak to subsequent non-spell saves
|
||||
if (game.lethalFantasy) delete game.lethalFantasy.spellDefense
|
||||
let beyondSkill = false
|
||||
let hasStaticModifier = false
|
||||
let hasExplode = true
|
||||
@@ -358,7 +360,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
dice,
|
||||
hasTarget: options.hasTarget,
|
||||
modifier,
|
||||
saveSpell: game.lethalFantasy?.spellDefense ?? false,
|
||||
saveSpell,
|
||||
favor: "none",
|
||||
targetName,
|
||||
isRangedAttack
|
||||
|
||||
Reference in New Issue
Block a user