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.
This commit is contained in:
toaster 2023-11-19 18:45:10 +00:00
parent bf0d0f39bc
commit c752990720

View file

@ -1747,14 +1747,16 @@ void Y_Ticker(void)
} }
// Animation sounds for roundqueue, see Y_RoundQueueDrawer // Animation sounds for roundqueue, see Y_RoundQueueDrawer
if (roundqueue.size != 0 if (roundqueue.size > 1
&& roundqueue.position != 0 && roundqueue.position != 0
&& (timer - 1) <= 2*TICRATE) && (timer - 1) <= 2*TICRATE)
{ {
const INT32 through = ((2*TICRATE) - (timer - 1)); const INT32 through = ((2*TICRATE) - (timer - 1));
UINT8 workingqueuesize = roundqueue.size - 1;
if (data.showrank == true if (data.showrank == true
&& roundqueue.position == roundqueue.size-1) && roundqueue.position == workingqueuesize)
{ {
// Handle special entry on the end // Handle special entry on the end
if (through == data.linemeter && timer > 2) if (through == data.linemeter && timer > 2)
@ -1767,11 +1769,20 @@ void Y_Ticker(void)
S_StartSound(NULL, sfx_gpmetr); S_StartSound(NULL, sfx_gpmetr);
} }
} }
else if (through == 9 else
&& roundqueue.position < roundqueue.size)
{ {
// Impactful landing if (data.showrank == false
S_StartSound(NULL, sfx_kc50); && roundqueue.entries[workingqueuesize].rankrestricted == true)
{
workingqueuesize--;
}
if (through == 9
&& roundqueue.position <= workingqueuesize)
{
// Impactful landing
S_StartSound(NULL, sfx_kc50);
}
} }
} }