Skip to content

Commit

Permalink
fix winner song not being sent to client (closes #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timtam committed Aug 1, 2024
1 parent b9b9fd5 commit caa7da8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions server/src/routes/games.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ pub fn guess_slot(

if state != game.state {
let last_scored = game.last_scored.clone();
let hit = game.hits_remaining.front().copied();
let winner = serv.game_service().lock().get_winner(&game);

if winner.is_some() {
Expand All @@ -343,13 +344,7 @@ pub fn guess_slot(
event: "change_state".into(),
state: Some(game.state),
players: Some(game.players.clone()),
hit: Some(game.state).and_then(|s| {
if s == GameState::Confirming {
game.hits_remaining.front().cloned()
} else {
None
}
}),
hit,
last_scored,
winner,
..Default::default()
Expand Down

0 comments on commit caa7da8

Please sign in to comment.