From: Holger Schemel Date: Fri, 17 Aug 2018 09:30:02 +0000 (+0200) Subject: fixed exiting players with custom elements when playing multi-player games X-Git-Tag: 4.1.1.0~79 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=6687b5314f1e08eb7364c0c5d753b96db18f6089;ds=sidebyside fixed exiting players with custom elements when playing multi-player games Before, exiting a player using custom element actions only worked in single-player mode. (In multi-player mode, the level was either immediately solved if the exited player was the "local player" (ignoring other players still existing on the playfield), or the exited player was not removed from the playfield, if it was not the "local player".) Now it works correctly also in multi-player games. --- diff --git a/src/game.c b/src/game.c index 4edcf7e8..c51b7ece 100644 --- a/src/game.c +++ b/src/game.c @@ -9776,7 +9776,10 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) { for (i = 0; i < MAX_PLAYERS; i++) if (action_arg_player_bits & (1 << i)) - PlayerWins(&stored_player[i]); + RemovePlayerWithCleanup(&stored_player[i]); + + if (AllPlayersGone) + PlayerWins(local_player); break; }