From 3d835aad6c3f10a0dab94fe28a86dd59d6513e91 Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Tue, 16 Jan 2024 23:50:32 +0000 Subject: [PATCH] fixed problem found in review --- lib/server.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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