From: Holger Schemel Date: Fri, 17 Aug 2018 09:08:37 +0000 (+0200) Subject: fixed solving level when playing multi-player games X-Git-Tag: 4.1.1.0~80 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=9e4358919afd28bdb4481eaf8daf4dcd4eca3e02;ds=sidebyside fixed solving level when playing multi-player games Before, solving a level was broken in both local and network multi-player games: In local multi-player games, the level was only solved if the player marked as "local player" (which is only one of all players in a level) entered the exit (but not if any other player entered the exit). As an additional bug, the level was *always* solved as soon as the "local player" entered the exit, regardless if any other player was still on the playfield. In network multi-player games, the level was always solved for the first player entering the exit (as this player is always the "local player" in one of the participating network clients), while the game was frozen on all other network clients (and had to be manually ended by using the Escape key or stop button). With this fix, multi-player games will always be solved (locally or on all network clients) if the last player on the playfield has entered the exit. --- diff --git a/src/game.c b/src/game.c index 7076d52c..4edcf7e8 100644 --- a/src/game.c +++ b/src/game.c @@ -12644,9 +12644,10 @@ void ScrollPlayer(struct PlayerInfo *player, int mode) { RemovePlayerWithCleanup(player); - if (local_player->friends_still_needed == 0 || - IS_SP_ELEMENT(Feld[jx][jy])) - PlayerWins(player); + if ((local_player->friends_still_needed == 0 || + IS_SP_ELEMENT(Feld[jx][jy])) && + AllPlayersGone) + PlayerWins(local_player); } /* this breaks one level: "machine", level 000 */