We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f6925d commit 7ba7ae7Copy full SHA for 7ba7ae7
1 file changed
src/ps/games/scrabble/index.ts
@@ -338,10 +338,12 @@ export class Scrabble extends Game<State> {
338
}
339
340
onReplacePlayer(oldPlayer: string, withPlayer: User): ActionResponse<Partial<Player>> {
341
- [this.state.score, this.state.racks, this.state.best].forEach(state => {
342
- state[withPlayer.id] = state[oldPlayer];
343
- delete state[oldPlayer];
344
- });
+ if (this.started) {
+ [this.state.score, this.state.racks, this.state.best].forEach(state => {
+ state[withPlayer.id] = state[oldPlayer];
+ delete state[oldPlayer];
345
+ });
346
+ }
347
return { success: true, data: {} };
348
349
0 commit comments