Skip to content

Commit a78502f

Browse files
authored
Merge pull request #287 from mcdemarco/develop
Frogger: new move list means fixing new hidden card errors
2 parents 8b7ecde + eb67c91 commit a78502f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/games/frogger.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,9 @@ export class FroggerGame extends GameBase {
497497
let points: string[] = [];
498498
const card = Card.deserialize(cardId);
499499
if (card === undefined) {
500-
throw new Error(`Could not deserialize the card ${cardId} in getNextForwardsForCard (from ${from}).`);
500+
//If you can see this, the front end is trying to generate moves
501+
// for the next player from his hidden hand cards. Be forgiving...
502+
return points;
501503
}
502504
const suits = card.suits.map(s => s.uid);
503505

@@ -984,6 +986,7 @@ export class FroggerGame extends GameBase {
984986
let to;
985987
const cardObj = Card.deserialize(card);
986988
if (cardObj === undefined) {
989+
//Already handled the hidden case, so something else is wrong.
987990
throw new Error(`Could not deserialize the card ${card} in randomMove.`);
988991
}
989992

0 commit comments

Comments
 (0)