added clearing network players from main menu screen if server disconnects
[rocksndiamonds.git] / src / network.c
index 010e8b33f6c6bef3931c50b2cf5884ca0b52575c..e703da0cd8a25ef326488c17ef6c440c2923de61 100644 (file)
@@ -518,6 +518,9 @@ static void Handle_OP_NUMBER_WANTED()
     Error(ERR_NETWORK_CLIENT, "cannot switch -- you keep client # %d",
          new_client_nr);
   }
+
+  if (game_status == GAME_MODE_MAIN)
+    DrawNetworkPlayers();
 }
 
 static void Handle_OP_PLAYER_NAME(unsigned int len)
@@ -591,6 +594,10 @@ static void Handle_OP_PLAYER_DISCONNECTED()
 
     DrawMainMenu();
   }
+  else if (game_status == GAME_MODE_MAIN)
+  {
+    DrawNetworkPlayers();
+  }
 }
 
 static void Handle_OP_START_PLAYING()
@@ -669,11 +676,11 @@ static void Handle_OP_STOP_PLAYING()
 
     if (buffer[2] != NETWORK_STOP_BY_PLAYER || stopped_by_remote_player)
       Request(message, REQ_CONFIRM | REQ_STAY_CLOSED);
-  }
 
-  SetGameStatus(GAME_MODE_MAIN);
+    SetGameStatus(GAME_MODE_MAIN);
 
-  DrawMainMenu();
+    DrawMainMenu();
+  }
 }
 
 static void Handle_OP_MOVE_PLAYER(unsigned int len)
@@ -852,6 +859,9 @@ void HandleNetworking()
     else
     {
       Request(error_message, REQ_CONFIRM);
+
+      if (game_status == GAME_MODE_MAIN)
+       ClearNetworkPlayers();
     }
   }
 }