diff --git a/app/routers/games/games.py b/app/routers/games/games.py index 2c90703..0967215 100644 --- a/app/routers/games/games.py +++ b/app/routers/games/games.py @@ -352,7 +352,7 @@ async def play_defense_card(game_name: str, defense_info: PlayDefenseInformation async def the_thing_end_game(game_name: str, player_id: int): utils.verify_player_is_the_thing(player_id, game_name) services.finish_game_by_the_thing(game_name) - + json_msg = { "event": utils.Events.GAME_ENDED } diff --git a/app/routers/games/services.py b/app/routers/games/services.py index 8df612e..8cd8d49 100644 --- a/app/routers/games/services.py +++ b/app/routers/games/services.py @@ -430,21 +430,19 @@ def get_game_result(name: str) -> GameResult: lambda p: p.rol == PlayerRol.THE_THING)[:] losers = game.players.select( lambda p: p.rol != PlayerRol.THE_THING)[:] - + elif no_human_remains(game): reason = "No queda ningĂșn Humano en la partida." winners = game.players.select( lambda p: p.rol in [PlayerRol.THE_THING, PlayerRol.INFECTED])[:] losers = game.players.select( lambda p: p.rol == PlayerRol.ELIMINATED)[:] - - - - #elif the_thing_declared_a_wrong_victory(game): + + # elif the_thing_declared_a_wrong_victory(game): else: reason = '''La Cosa ha declarado una victoria equivocada. Todavia queda algĂșn humano vivo.''' winners = game.players.select( - lambda p: p.rol in [PlayerRol.HUMAN, PlayerRol.INFECTED])[:] + lambda p: p.rol == PlayerRol.HUMAN)[:] losers = game.players.select( lambda p: p.rol != PlayerRol.HUMAN)[:] diff --git a/app/routers/games/utils.py b/app/routers/games/utils.py index af55d02..58a626d 100644 --- a/app/routers/games/utils.py +++ b/app/routers/games/utils.py @@ -150,7 +150,7 @@ def verify_player_is_the_thing(player_id, game_name): status_code=status.HTTP_400_BAD_REQUEST, detail=f"The player {player.name}, with id= {player.id} is not The Thing" ) - + @db_session def verify_game_can_be_finished(game: Game):