From c752990720955f8f6cfe19b6e17f9ff1b41f2625 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 19 Nov 2023 18:45:10 +0000 Subject: [PATCH] Y_Ticker, roundqueue contexts: Fix for leaking existence of rank-restricted entries The player pin jumping "clack" sound was improperly guarded from happening when reaching the end of a GP without accomplishing a Sealed Star. --- src/y_inter.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 645f27556..2650ac526 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1747,14 +1747,16 @@ void Y_Ticker(void) } // Animation sounds for roundqueue, see Y_RoundQueueDrawer - if (roundqueue.size != 0 + if (roundqueue.size > 1 && roundqueue.position != 0 && (timer - 1) <= 2*TICRATE) { const INT32 through = ((2*TICRATE) - (timer - 1)); + UINT8 workingqueuesize = roundqueue.size - 1; + if (data.showrank == true - && roundqueue.position == roundqueue.size-1) + && roundqueue.position == workingqueuesize) { // Handle special entry on the end if (through == data.linemeter && timer > 2) @@ -1767,11 +1769,20 @@ void Y_Ticker(void) S_StartSound(NULL, sfx_gpmetr); } } - else if (through == 9 - && roundqueue.position < roundqueue.size) + else { - // Impactful landing - S_StartSound(NULL, sfx_kc50); + if (data.showrank == false + && roundqueue.entries[workingqueuesize].rankrestricted == true) + { + workingqueuesize--; + } + + if (through == 9 + && roundqueue.position <= workingqueuesize) + { + // Impactful landing + S_StartSound(NULL, sfx_kc50); + } } }