diff --git a/lib/server.ex b/lib/server.ex index 92e257d..adc8e58 100644 --- a/lib/server.ex +++ b/lib/server.ex @@ -140,13 +140,13 @@ defmodule Server do state = qurey_status(state) game = state.games[game_id] cond do - game.modified -> - safecast(pid_to_inform, {:make_move, game_id, :player_moved_before, game.game_state, game.hand}) - set_modifed(state, game_id) is_finished(game, game_id) -> {_, score} = state.games[game_id] safecast(pid_to_inform, {:make_move, game_id, :game_finished, score}) state + game.modified -> + safecast(pid_to_inform, {:make_move, game_id, :player_moved_before, game.game_state, game.hand}) + set_modifed(state, game_id) true -> try_to_play(state, game_id, move, pid_to_inform) end