From: Holger Schemel Date: Wed, 24 Mar 2021 23:29:16 +0000 (+0100) Subject: fixed mouse button CE change events for older levels X-Git-Tag: 4.3.0.0~199 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=f0bec2935a69513658571cd766150be5476b0849;p=rocksndiamonds.git fixed mouse button CE change events for older levels --- diff --git a/src/files.c b/src/files.c index 1909cbec..42d74dbf 100644 --- a/src/files.c +++ b/src/files.c @@ -6610,6 +6610,27 @@ static void LoadLevel_InitCustomElements(struct LevelInfo *level) element_info[element].ignition_delay = 8; } } + + // set mouse click change events to work for left/middle/right mouse button + if (level->game_version < VERSION_IDENT(4,2,3,0)) + { + for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) + { + int element = EL_CUSTOM_START + i; + struct ElementInfo *ei = &element_info[element]; + + for (j = 0; j < ei->num_change_pages; j++) + { + struct ElementChangeInfo *change = &ei->change_page[j]; + + if (change->has_event[CE_CLICKED_BY_MOUSE] || + change->has_event[CE_PRESSED_BY_MOUSE] || + change->has_event[CE_MOUSE_CLICKED_ON_X] || + change->has_event[CE_MOUSE_PRESSED_ON_X]) + change->trigger_side = CH_SIDE_ANY; + } + } + } } static void LoadLevel_InitElements(struct LevelInfo *level)