From 38258fc40ad9766224b6f501427346c6fdfd55ee Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 25 Jan 2024 03:19:23 +0000 Subject: [PATCH] M_CupSelectHandler: small code cleanup done while writing the previous commit --- src/menus/transient/cup-select.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/menus/transient/cup-select.c b/src/menus/transient/cup-select.c index 7882d0cc9..b9ded0482 100644 --- a/src/menus/transient/cup-select.c +++ b/src/menus/transient/cup-select.c @@ -265,12 +265,21 @@ void M_CupSelectHandler(INT32 choice) M_SetMenuDelay(pid); + if (!newcup) + { + S_StartSound(NULL, sfx_s3kb2); + return; + } + levellist.levelsearch.cup = newcup; count = M_CountLevelsToShowInList(&levellist.levelsearch); - if ((!newcup) - || (count == 0) - || (cupgrid.grandprix == true && newcup->cachedlevels[0] == NEXTMAP_INVALID)) + if (count == 0 + || ( + cupgrid.grandprix == true + && newcup->cachedlevels[0] == NEXTMAP_INVALID + ) + ) { S_StartSound(NULL, sfx_s3kb2); return;