fixed showing message request if local player stopped network game
authorHolger Schemel <info@artsoft.org>
Wed, 6 Jun 2018 06:43:28 +0000 (08:43 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 18 Jun 2018 17:47:31 +0000 (19:47 +0200)
src/network.c

index 4b6257588647ae63ec91efa21dc16cd6e925c7ca..b55e68e7a584d5a017cd97c4faa0fe8feb99a67d 100644 (file)
@@ -544,13 +544,17 @@ static void Handle_OP_STOP_PLAYING()
 
   if (game_status == GAME_MODE_PLAYING)
   {
+    int client_nr = buffer[0];
+    int index_nr = client_nr - 1;
+    boolean stopped_by_remote_player = (index_nr != local_player->index_nr);
     char *message = (buffer[2] == NETWORK_STOP_BY_PLAYER ?
                     "Network game stopped by player!" :
                     buffer[2] == NETWORK_STOP_BY_ERROR ?
                     "Network game stopped due to internal error!" :
                     "Network game stopped!");
 
-    Request(message, REQ_CONFIRM | REQ_STAY_CLOSED);
+    if (buffer[2] != NETWORK_STOP_BY_PLAYER || stopped_by_remote_player)
+      Request(message, REQ_CONFIRM | REQ_STAY_CLOSED);
   }
 
   SetGameStatus(GAME_MODE_MAIN);