From 6687b5314f1e08eb7364c0c5d753b96db18f6089 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 17 Aug 2018 11:30:02 +0200 Subject: [PATCH] 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. --- src/game.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.34.1