From: Holger Schemel Date: Fri, 18 May 2018 08:04:37 +0000 (+0200) Subject: fixed network games, part 2: set player focus after setting local player X-Git-Tag: 4.1.1.0~178 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c3efcbe424037ee1c2ec2d6e22ecfea4de589c47;p=rocksndiamonds.git fixed network games, part 2: set player focus after setting local player There was also a bug with setting the focussed player to the local player where the local player potentially changed afterwards (if the player for network games was assigned to any player in the playfield different from the player that was selected for network games by the user on program start). To fix this, the code to set the focussed player for network games was moved to a point after setting the local player. --- diff --git a/src/game.c b/src/game.c index a17dc326..fbe9fd00 100644 --- a/src/game.c +++ b/src/game.c @@ -3545,18 +3545,6 @@ void InitGame() game.envelope_active = FALSE; - /* set focus to local player for network games, else to all players */ - game.centered_player_nr = (network_playing ? local_player->index_nr : -1); - game.centered_player_nr_next = game.centered_player_nr; - game.set_centered_player = FALSE; - - if (network_playing && tape.recording) - { - /* store client dependent player focus when recording network games */ - tape.centered_player_nr_next = game.centered_player_nr_next; - tape.set_centered_player = TRUE; - } - for (i = 0; i < NUM_BELTS; i++) { game.belt_dir[i] = MV_NONE; @@ -3895,6 +3883,18 @@ void InitGame() printf("::: local_player->present == %d\n", local_player->present); #endif + /* set focus to local player for network games, else to all players */ + game.centered_player_nr = (network_playing ? local_player->index_nr : -1); + game.centered_player_nr_next = game.centered_player_nr; + game.set_centered_player = FALSE; + + if (network_playing && tape.recording) + { + /* store client dependent player focus when recording network games */ + tape.centered_player_nr_next = game.centered_player_nr_next; + tape.set_centered_player = TRUE; + } + if (tape.playing) { /* when playing a tape, eliminate all players who do not participate */