From: Holger Schemel Date: Wed, 12 Aug 2020 18:56:01 +0000 (+0200) Subject: fixed bug with reanimating killed player by CE condition X-Git-Tag: 4.2.0.0^0 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=60905b7f08ae9a2c88299731a8ce490c31d8b6e0 fixed bug with reanimating killed player by CE condition When checking for CE condition "explosion of " using the player as , it is possible to create a new player right after the player died (exploded). However, this only worked when directly changing the CE to the player, but not when using an extended change target (to create the player on some adjacent tile next to the CE) that puts the new player on a tile that is walkable (which is especially true for tiles that are empty). This change fixes this bug. (The problematic code is in function "CreateFieldExt()", but always checking for reanimating a killed player in "InitPlayerField()" seems to be the better (more clean) fix for this bug.) --- diff --git a/src/game.c b/src/game.c index 9e0327a4..d67a91a0 100644 --- a/src/game.c +++ b/src/game.c @@ -1785,7 +1785,7 @@ static void InitPlayerField(int x, int y, int element, boolean init_game) player->jy = player->last_jy = y; } - if (!init_game) + // always check if player was just killed and should be reanimated { int player_nr = GET_PLAYER_NR(element); struct PlayerInfo *player = &stored_player[player_nr];