One of my users is having an issue with the latest update of a game I'm making. His complaint, specifically:
"I seem to be having issues with the combat this update. It says "Error: <<FightMenu>>: cannot execute widget: Cannot read property 'toLowerCase' of undefined" when I try to fight something."
However, I can't seem to replicate his error, and I'm rather at a loss as to what the underlying issue is. Here is the primary widget in question:
<<widget "FightMenu">><span id = "FightMenu"><<ChooseTarget>><<if $charmedTurnsLeft > 0>><<Resist>><<else>><<if $tethered>><<RemoveTether>><br><</if>><<Attack>><br><<DodgeAndWait>><br><<Flee>><br><<Spellbook>><</if>></span><</widget>>
And here are the sub-widgets it calls:
<<widget "ChooseTarget">>Target: <<for $targetButtons to 0; $targetButtons < $foeRoster.length; $targetButtons++>><<radiobutton "$target" $targetButtons checked>> $foeRoster[$targetButtons]: $foeHP[$targetButtons] HP <</for>><br><</widget>>
<<widget "Resist">><<click "Try to Resist">><<replace "#fight">>You can do nothing but struggle to regain control of your body as the $foeName clouds your mind!<br><<updateStatusTimers>><<FoeActs>><</replace>><</click>><</widget>>
<<widget "RemoveTether">><<click "Remove the harpoon">><<replace "#fight">>With a tug on the filament connecting the harpoon, you untether yourself from the Ampion.<<set $tethered = false>><br><<updateStatusTimers>><<FoeActs>><</replace>><</click>><</widget>>
<<widget "Attack">><<click "Attack!">><<LoadTarget>><<replace "#fight">>You strike at the $foeName!<br><<rollStats $charCombat $wepAcc>><<rollFoeStat $foeDodge>><<if $successes >= $foeSuccesses>>$foePain, taking <<set $atkDamage = Math.round((($charStr*0.8) + $wepStr + $strMod)*either(.8,.9,1,1.1,1.2)) - $foeArmor>> $atkDamage damage!<<set $foeHP[$target] -= $atkDamage>><<Retaliation>><<else>>However, the $foeName evades the blow.<</if>><br><<CheckFoeHP>><<replace "#FightMenu">><<FightMenu>><</replace>><<updateStatusTimers>><<CheckVictory>><<FoeActs>><</replace>><</click>><</widget>>
<<widget "DodgeAndWait">><<click "Defend and wait">><<replace "#fight">><<beginFullDefense>><<set $fullDefense = 2>>You decide to wait and maintain your defense.<<if $foeCurrentHP > 0>> Foe's HP: $foeCurrentHP <<updateStatusTimers>><<FoeActs>><<else>><<replace "#foe">><</replace>><<replace "#FightMenu">>You've won the battle!<br><<updateStatusTimers>>[[Continue| $foeDeath]]<</replace>><</if>><</replace>><</click>><</widget>>
<<widget "Flee">><<click "Flee!">><<rollStats $charAgi $agiMod>><<rollFoeStat $foeChase>><<if $successes > $foeSuccesses>><<replace "#fight">>You manage to get some distance from the $foeName, eluding it for now.<</replace>><<replace "#foe">><</replace>><<replace "#FightMenu">><<updateStatusTimers>><<cleanUp>><<basicExplore>><</replace>><<else>><<replace "#fight">>You try to escape from the $foeName, but it proves too quick and cuts you off!<</replace>><<updateStatusTimers>><<FoeActs>><</if>><</click>><</widget>>
<<widget "Spellbook">><<if $bioMagicMastery >= 1>><<Boneblast>><br><<if $cooldownTurnsLeft == 0>><<TitanStrength>><<else>>Cannot cast Titan Strength while on cooldown!<</if>><br><</if>><<if $stormMagicMastery >= 1>><<Whizbang>><br><<if $cooldownTurnsLeft == 0>><<Slipstream>><<else>>Cannot cast Slipstream while on cooldown!<</if>><br><</if>><<if $fireMagicMastery >= 1>><<if $cooldownTurnsLeft == 0>><<ScorchingSphere>><<else>>Cannot cast Scorching Sphere while on cooldown!<</if>><</if>><</widget>>
My inability to replicate, along with the fact that the error occurs in a control widget, is really hurting my ability to hunt this one down. Any help would be appreciated.