From f4eb9a8607cf66cf4dfcf84f19c76da6d35437cb Mon Sep 17 00:00:00 2001 From: Artur Rojek Date: Sun, 11 Dec 2022 23:41:54 +0100 Subject: [PATCH] Prevent clicking on racer scroll buttons when hidden (#263) * Prevent clicking on racer scroll buttons when hidden (#262) Fix a bug where racers could be scrolled in other view modes, messing up the screen. Signed-off-by: Artur Rojek Co-authored-by: Dethrace Engineering Department <78985374+dethrace-labs@users.noreply.github.com> --- src/DETHRACE/common/racestrt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/DETHRACE/common/racestrt.c b/src/DETHRACE/common/racestrt.c index 9f5c5409..b61973c4 100644 --- a/src/DETHRACE/common/racestrt.c +++ b/src/DETHRACE/common/racestrt.c @@ -1282,6 +1282,12 @@ int TryToMoveToArrows(int* pCurrent_choice, int* pCurrent_mode) { int UpOpponent(int* pCurrent_choice, int* pCurrent_mode) { LOG_TRACE("(%p, %p)", pCurrent_choice, pCurrent_mode); +#if defined(DETHRACE_FIX_BUGS) + // fixes bug where racers could be scrolled in other race menu modes + if (gProgram_state.view_type != eVT_Opponents) { + return 0; + } +#endif AddToFlicQueue(gStart_interface_spec->pushed_flics[5].flic_index, gStart_interface_spec->pushed_flics[5].x[gGraf_data_index], gStart_interface_spec->pushed_flics[5].y[gGraf_data_index], @@ -1310,6 +1316,12 @@ int UpOpponent(int* pCurrent_choice, int* pCurrent_mode) { int DownOpponent(int* pCurrent_choice, int* pCurrent_mode) { LOG_TRACE("(%p, %p)", pCurrent_choice, pCurrent_mode); +#if defined(DETHRACE_FIX_BUGS) + // fixes bug where racers could be scrolled in other race menu modes + if (gProgram_state.view_type != eVT_Opponents) { + return 0; + } +#endif AddToFlicQueue(gStart_interface_spec->pushed_flics[6].flic_index, gStart_interface_spec->pushed_flics[6].x[gGraf_data_index], gStart_interface_spec->pushed_flics[6].y[gGraf_data_index],