fixed initializing locally connected player in single player mode
authorHolger Schemel <info@artsoft.org>
Sat, 29 Feb 2020 13:40:36 +0000 (14:40 +0100)
committerHolger Schemel <info@artsoft.org>
Tue, 19 May 2020 16:20:01 +0000 (18:20 +0200)
src/game.c

index 128c677f603ed1bac536fd04480b656e20160d9d..d5256fd4ed0cd9b6b1bb62e7b3c319aa540b09eb 100644 (file)
@@ -3753,12 +3753,13 @@ void InitGame(void)
   // use preferred player also in local single-player mode
   if (!network.enabled && !game.team_mode)
   {
-    int old_index_nr = local_player->index_nr;
     int new_index_nr = setup.network_player_nr;
 
     if (new_index_nr >= 0 && new_index_nr < MAX_PLAYERS)
     {
-      stored_player[old_index_nr].connected_locally = FALSE;
+      for (i = 0; i < MAX_PLAYERS; i++)
+       stored_player[i].connected_locally = FALSE;
+
       stored_player[new_index_nr].connected_locally = TRUE;
     }
   }