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)