fix for prev_turn has no effect when mid-chain
This commit is contained in:
parent
cba11ec0c8
commit
a7df98a990
|
|
@ -789,12 +789,15 @@ $(function (){
|
|||
});
|
||||
|
||||
$('#cb_nav_prev_turn').on('click', function(){
|
||||
const player = visibleGame.player;
|
||||
while (visibleGame.canUndo) {
|
||||
if (visibleGame.canUndo) {
|
||||
visibleGame.undo();
|
||||
if (visibleGame.player === player) {
|
||||
visibleGame.redo();
|
||||
break;
|
||||
const player = visibleGame.player;
|
||||
while (visibleGame.canUndo) {
|
||||
visibleGame.undo();
|
||||
if (visibleGame.player !== player) {
|
||||
visibleGame.redo();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
renderBoard();
|
||||
|
|
|
|||
Loading…
Reference in New Issue