From 60905b7f08ae9a2c88299731a8ce490c31d8b6e0 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 12 Aug 2020 20:56:01 +0200 Subject: [PATCH] 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.) --- src/game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; -- 2.34.1