From ebaa651c0d899a017851a3b40ed5490d52bfb7e6 Mon Sep 17 00:00:00 2001 From: Jiri Kalvoda Date: Wed, 14 Sep 2022 15:13:57 +0200 Subject: [PATCH] =?UTF-8?q?Startegick=C3=A1:=20Oprava=20hern=C3=AD=20logik?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/hra/game.py | 2 +- server/hra/lib.py | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/server/hra/game.py b/server/hra/game.py index 784b8f5..e20bc34 100644 --- a/server/hra/game.py +++ b/server/hra/game.py @@ -130,7 +130,7 @@ class Occupy(Logic): for team_id, move in enumerate(moves): if move is not None: for member in move["members"]: - if member["id"] not in id_positions: + if member["id"] not in id_positions[team_id]: # Neplatné ID vojáka continue id_moves[team_id][member["id"]] = member["action"] diff --git a/server/hra/lib.py b/server/hra/lib.py index 99ad62a..b695ec8 100644 --- a/server/hra/lib.py +++ b/server/hra/lib.py @@ -29,18 +29,10 @@ def game_step(game_id: int): for i in ses.query(db.Move).filter_by(game_id=game.game_id, round=old_round_id).all(): moves[i.team_id] = i.get_move() - print(old_state) - print(moves) - print(old_round_id) - print() - ses.commit() x, points = game.get_logic().step(old_state, moves, old_round_id) - print(x) - print(points) - new_state = db.State(game_id=game.game_id, round=new_round_id, state=db.new_big_data(x), create_time=time) ses.add(new_state)