orichalque/yet-an-other-gloomhaven-companion

BUG: CS Special modifiers throwing Undefined error

Opened this issue · 0 comments

To Replicate:
Switch to the Crimson Scales expansion (even if already selected)
Add ANY modifier
Errors occur in JS console

Issue:
checkIfSanctuary in modifiers.js causing new game to not work & anomalous behaviour when playing modifiers (same modifier keeps playing over & over)

Temp work-around:
Either revert PR #277 or
Add element.name !== undefined && to the filter on line 146, ie:
const sanctuaryCards = this.modifiersSpecial.find(element => element.name !== undefined && element.name.startsWith(sanctuaryNamePrefix))

Working on actual fix

Debugging:

loaded crimson scales
vue.js:634 [Vue warn]: Error in v-on handler: "TypeError: Cannot read properties of undefined (reading 'startsWith')"

(found in <Root>)
warn @ vue.js:634
logError @ vue.js:1893
globalHandleError @ vue.js:1888
handleError @ vue.js:1848
invokeWithErrorHandling @ vue.js:1871
invoker @ vue.js:2188
original._wrapper @ vue.js:7547
vue.js:1897 TypeError: Cannot read properties of undefined (reading 'startsWith')
    at modifiers.js:146:88
    at Array.find (<anonymous>)
    at Vue.checkIfSanctuary (modifiers.js:146:58)
    at Vue.checkIfBlessing (modifiers.js:154:117)
    at Vue.removeModifier (modifiers.js:120:22)
    at click (eval at createFunction (vue.js:1:1), <anonymous>:3:24828)
    at invokeWithErrorHandling (vue.js:1863:28)
    at HTMLDivElement.invoker (vue.js:2188:16)
    at original._wrapper (vue.js:7547:27)