fixed bug with synchronization problem with "play again" in network mode
authorHolger Schemel <info@artsoft.org>
Fri, 12 Oct 2018 21:21:24 +0000 (23:21 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 12 Oct 2018 21:21:26 +0000 (23:21 +0200)
This bug caused different frame counters at the network server and
network client due to executing "GameActions()" directly after
restarting the game in "RequestRestartGame()", which increments the
frame counter on the client, but not on the server in the first game
frame.

src/screens.c

index ae4f7038dde2b8c6741dcf874f36942bd909e65a..1a40ae7cb291fbe96c9914acad764fed22ee0d0a 100644 (file)
@@ -8214,8 +8214,12 @@ void HandleGameActions(void)
   CheckGameOver();
 
   if (game.restart_game_message != NULL)
+  {
     RequestRestartGame(game.restart_game_message);
 
+    return;
+  }
+
   if (game_status != GAME_MODE_PLAYING)
     return;