DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

06d3c82f365b80de2245ed40d3008a95249499cf — Jonni Liljamo 1 year, 7 months ago 045dc64
feat(client): check for empty deck for a second time before drawing
1 files changed, 6 insertions(+), 3 deletions(-)

M client/src/game_status/parser.rs
M client/src/game_status/parser.rs => client/src/game_status/parser.rs +6 -3
@@ 136,9 136,12 @@ fn parse_action(action: &Action, game: &Game, game_status: &mut GameStatus) {
                    shuffle_discard_to_deck(target, action.seed.parse::<u64>().unwrap());
                }

                target
                    .hand
                    .push(target.deck.pop().unwrap_or_else(|| unreachable!()));
                // NOTE: deck *might* still be empty, if discard was empty too
                if !target.deck.is_empty() {
                    target
                        .hand
                        .push(target.deck.pop().unwrap_or_else(|| unreachable!()));
                }
            }
        }
        Command::Discard { index } => {