fixed re-opening request door after stopping network game
authorHolger Schemel <info@artsoft.org>
Wed, 6 Jun 2018 06:28:10 +0000 (08:28 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 18 Jun 2018 17:47:31 +0000 (19:47 +0200)
src/network.c

index 1c9e0b0d30a10b063a504ddbc5af5fb6ff670f81..4b6257588647ae63ec91efa21dc16cd6e925c7ca 100644 (file)
@@ -544,12 +544,13 @@ static void Handle_OP_STOP_PLAYING()
 
   if (game_status == GAME_MODE_PLAYING)
   {
-    if (buffer[2] == NETWORK_STOP_BY_PLAYER)
-      Request("Network game stopped by player!", REQ_CONFIRM);
-    else if (buffer[2] == NETWORK_STOP_BY_ERROR)
-      Request("Network game stopped due to internal error!", REQ_CONFIRM);
-    else
-      Request("Network game stopped!", REQ_CONFIRM);
+    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);
   }
 
   SetGameStatus(GAME_MODE_MAIN);