Skip to content

Commit 30b4a05

Browse files
committed
games: Don't show NaNs in Splendor if all but one player forfeits
1 parent f3d01e9 commit 30b4a05

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ps/games/splendor/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class Splendor extends BaseGame<State> {
112112

113113
AllTokenTypes.forEach(tokenType => {
114114
const meta = metadata.types[tokenType].startCount;
115-
const reduceTokens = meta[playerCount - 2] - meta[playerCount - 2 - 1];
115+
const reduceTokens = meta[playerCount - 2] ?? 0 - meta[playerCount - 2 - 1] ?? 0;
116116
this.state.board.tokens[tokenType] += playerData.tokens[tokenType] - reduceTokens;
117117
playerData.tokens[tokenType] = 0;
118118
if (this.state.board.tokens[tokenType] < 0) this.state.board.tokens[tokenType] = 0;

0 commit comments

Comments
 (0)