diff --git a/src/main/java/server/mvp/Model/ModelServer.java b/src/main/java/server/mvp/Model/ModelServer.java index cb8592c..90402a0 100644 --- a/src/main/java/server/mvp/Model/ModelServer.java +++ b/src/main/java/server/mvp/Model/ModelServer.java @@ -104,8 +104,10 @@ public void addPresenter(int p_id, IPresenter p) { generateNewItem(p_id); free_games.offerLast(games.size()-1); } else { - presenter_game.add(p_id, free_games.pollFirst()); + int gameId = free_games.pollFirst(); + presenter_game.add(p_id, gameId); updateSecondPlayer(p_id); + gameStart(gameId); } addSnake(p_id); refresh(getGameId(p_id));