I've been following the current hearts tutorial ( https://en.doc.boardgamearena.com/Tutor ... teractions ) and got through the steps right before the "cardswon" step.
Things seemed to be working up until this point, but now after connecting the various state transitions I'm hitting an error in this block:
The final line with the .addCards() call is failing with error: Technical error: Cannot read properties of undefined (reading 'addCards')
It doesn't fail when the game first loads, but fails when switching to the 2nd or 3rd player's turn.
The previous temporary call to this.tableauStocks[player.id].addCards with a dummy index value worked fine, so this seems to be an issue with iterating through the 'cardsontable' returned from 'gamedatas' and I can't figure out how to troubleshoot it any further.
Things seemed to be working up until this point, but now after connecting the various state transitions I'm hitting an error in this block:
Code: Select all
// Cards played on table
for (i in this.gamedatas.cardsontable) {
var card = this.gamedatas.cardsontable[i];
var player_id = card.location_arg;
this.tableauStocks[player_id].addCards([card]);
}It doesn't fail when the game first loads, but fails when switching to the 2nd or 3rd player's turn.
The previous temporary call to this.tableauStocks[player.id].addCards with a dummy index value worked fine, so this seems to be an issue with iterating through the 'cardsontable' returned from 'gamedatas' and I can't figure out how to troubleshoot it any further.