We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3d01e9 commit 30b4a05Copy full SHA for 30b4a05
1 file changed
src/ps/games/splendor/index.ts
@@ -112,7 +112,7 @@ export class Splendor extends BaseGame<State> {
112
113
AllTokenTypes.forEach(tokenType => {
114
const meta = metadata.types[tokenType].startCount;
115
- const reduceTokens = meta[playerCount - 2] - meta[playerCount - 2 - 1];
+ const reduceTokens = meta[playerCount - 2] ?? 0 - meta[playerCount - 2 - 1] ?? 0;
116
this.state.board.tokens[tokenType] += playerData.tokens[tokenType] - reduceTokens;
117
playerData.tokens[tokenType] = 0;
118
if (this.state.board.tokens[tokenType] < 0) this.state.board.tokens[tokenType] = 0;
0 commit comments