From: Holger Schemel Date: Sat, 11 Dec 2021 11:35:17 +0000 (+0100) Subject: added counting mouse clicks on mouse click CEs when using step counter X-Git-Tag: 4.3.1.0~4 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=7f8a11cd9d715fb89fd2ed168019fa05753bc5ea;p=rocksndiamonds.git added counting mouse clicks on mouse click CEs when using step counter --- diff --git a/src/game.c b/src/game.c index 11311009..87c054a2 100644 --- a/src/game.c +++ b/src/game.c @@ -12326,6 +12326,25 @@ void GameActions_RND(void) CheckElementChangeByMouse(x, y, element, CE_PRESSED_BY_MOUSE, ch_button); CheckTriggeredElementChangeByMouse(x, y, element, CE_MOUSE_PRESSED_ON_X, ch_button); + + if (level.use_step_counter) + { + boolean counted_click = FALSE; + + // element clicked that can change when clicked/pressed + if (CAN_CHANGE_OR_HAS_ACTION(element) && + (HAS_ANY_CHANGE_EVENT(element, CE_CLICKED_BY_MOUSE) || + HAS_ANY_CHANGE_EVENT(element, CE_PRESSED_BY_MOUSE))) + counted_click = TRUE; + + // element clicked that can trigger change when clicked/pressed + if (trigger_events[element][CE_MOUSE_CLICKED_ON_X] || + trigger_events[element][CE_MOUSE_PRESSED_ON_X]) + counted_click = TRUE; + + if (new_button && counted_click) + CheckLevelTime_StepCounter(); + } } SCAN_PLAYFIELD(x, y)