added using preferred network player also in single-player mode
authorHolger Schemel <info@artsoft.org>
Fri, 4 Jan 2019 17:03:14 +0000 (18:03 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 4 Jan 2019 17:03:14 +0000 (18:03 +0100)
src/game.c

index 99540b1..52ea432 100644 (file)
@@ -3738,6 +3738,19 @@ void InitGame(void)
       game.belt_dir_nr[i] = 3;         // not moving, next moving left
 
 #if USE_NEW_PLAYER_ASSIGNMENTS
+  // 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;
+      stored_player[new_index_nr].connected_locally = TRUE;
+    }
+  }
+
   for (i = 0; i < MAX_PLAYERS; i++)
   {
     stored_player[i].connected = FALSE;