Skip to content

Commit d5c61ad

Browse files
committed
games: Fix Scrabble exchange limit
1 parent 4b460ae commit d5c61ad

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/ps/games/scrabble/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ export class Scrabble extends Game<State> {
263263
const turn = this.turn!;
264264
const player = this.players[turn];
265265
if (!player) this.throw();
266+
if (this.state.bag.length < RACK_SIZE) this.throw('GAME.SCRABBLE.BAG_SIZE', { amount: this.state.bag.length });
266267
if (!letterList || letterList.length === 0) this.throw();
267268

268269
const letters = letterList
@@ -272,8 +273,6 @@ export class Scrabble extends Game<State> {
272273
if (!letters.length) this.throw();
273274
const letterCount = letters.count();
274275

275-
if (this.state.bag.length < letters.length) this.throw('GAME.SCRABBLE.BAG_SIZE', { amount: this.state.bag.length });
276-
277276
const rack = this.state.racks[turn];
278277
const rackCount = rack.count();
279278

0 commit comments

Comments
 (0)