From: Holger Schemel Date: Mon, 17 Dec 2018 08:14:05 +0000 (+0100) Subject: fixed bug with CE actions "show envelope" and "exit player" when moving X-Git-Tag: 4.1.2.0~77 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=f360f1c76a4160a3da1e2863d22d670d3f44e900;p=rocksndiamonds.git fixed bug with CE actions "show envelope" and "exit player" when moving When using the CE actions "show envelope" or "exit player" with the condition "after explosion of player", those actions are not performed if the player was moving at the time of explosion, as they are both waiting for the player to reach the next tile (which will never happen in this case). The best solution is to only check for a "non-moving" tile position of the player if the player is still active, which will fix the problem. However, as the check for a "non-moving" tile position is used very frequently, setting the tile position to "non-moving" for inactive players was added. --- diff --git a/src/game.c b/src/game.c index d517cdc0..6463df1b 100644 --- a/src/game.c +++ b/src/game.c @@ -4503,7 +4503,7 @@ void GameWon(void) int i; // do not start end game actions before the player stops moving (to exit) - if (local_player->MovPos) + if (local_player->active && local_player->MovPos) return; game.LevelSolved_GameWon = TRUE; @@ -12164,7 +12164,8 @@ void GameActions_RND(void) DrawAllPlayers(); PlayAllPlayersSound(); - if (local_player->show_envelope != 0 && local_player->MovPos == 0) + if (local_player->show_envelope != 0 && (!local_player->active || + local_player->MovPos == 0)) { ShowEnvelope(local_player->show_envelope - EL_ENVELOPE_1); @@ -13451,6 +13452,9 @@ void RemovePlayer(struct PlayerInfo *player) player->present = FALSE; player->active = FALSE; + // required for some CE actions (even if the player is not active anymore) + player->MovPos = 0; + if (!ExplodeField[jx][jy]) StorePlayer[jx][jy] = 0;