Hot seat and Undo

Game development with Board Game Arena Studio
Post Reply
User avatar
FindYodaWinCash
Posts: 15
Joined: 15 June 2020, 00:41

Hot seat and Undo

Post by FindYodaWinCash »

Hi Folks,

So I've taken advantage of the new hotseat functionality to make sure everything is going smoothly in production.

I use undoRestorePoint(); to implement undo. Whenever the player does this, their turn goes fine, but when the screen comes up for the next player to take their turn, clicking on the "play" button does nothing. It hangs there. F5 fixes this. The screen comes up again and the play button works as normal.

Perhaps I am saving state in the wrong place? I am doing it in stNextPlayer():

Code: Select all

 function stNextPlayer()
    {
        // Active next player
        $player_id = self::activeNextPlayer();
        $players = self::getPlayersWithIDKey();

        if ($players[$player_id]['trainposition'] == NULL) {
                 
            $this->undoSavepoint();
            $this->gamestate->nextState('firstAction');
        } else {
            $this->gamestate->nextState('rollDice');
        }
    }
    
    
Thanks!
Post Reply

Return to “Developers”