Skip to content

Commit 1688107

Browse files
committed
games: Fix a bug with subbing (didn't update turn order when subbing in a non-meta.turns game)
1 parent 4c299ba commit 1688107

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/ps/games/game.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ export class BaseGame<State extends BaseState> {
336336
delete this.players[oldPlayer.id];
337337
const newTurn = this.meta.turns ? turn : withPlayer.id;
338338
this.players[newTurn] = { ...oldPlayer, ...assign, turn: newTurn };
339+
if (!this.meta.turns) this.turns.splice(this.turns.indexOf(turn), 1, newTurn);
339340
this.spectators.remove(oldPlayer.id);
340341
this.backup();
341342
return { success: true, data: this.$T('GAME.SUB', { in: withPlayer.name, out: oldPlayer.name }) };

0 commit comments

Comments
 (0)