From 30c779b9e53dec1f45717ae749cc9280c3235e50 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 18 Jul 2021 12:49:52 +0200 Subject: [PATCH] fixed triggering CE actions by digging or collecting The improvement for CE actions by digging or collecting elements not triggering before the dig or collect action was completely finished had a very nasty bug in that such CE events when triggered by snapping that element (which also counts as digging or collecting) just did not work. This bug is fixed by this change. This fixes commit ca2d6507. --- src/game.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game.c b/src/game.c index 2535720a..c3dc82cc 100644 --- a/src/game.c +++ b/src/game.c @@ -13968,7 +13968,11 @@ static void TestFieldAfterSnapping(int x, int y, int element, int direction, if (level.finish_dig_collect) { int dig_side = MV_DIR_OPPOSITE(direction); + int change_event = (IS_DIGGABLE(element) ? CE_PLAYER_DIGS_X : + CE_PLAYER_COLLECTS_X); + CheckTriggeredElementChangeByPlayer(x, y, element, change_event, + player_index_bit, dig_side); CheckTriggeredElementChangeByPlayer(x, y, element, CE_PLAYER_SNAPS_X, player_index_bit, dig_side); } -- 2.34.1