Allow emerald hunt radar to function if emblem radar is on but all emblems have been collected.

This commit is contained in:
Sally Coolatta 2022-03-03 10:26:04 -05:00
parent fb5b8ce1be
commit 87e468f365

View file

@ -2545,7 +2545,7 @@ static void ST_doHuntIconsAndSound(void)
S_StartSound(NULL, sfx_emfind); S_StartSound(NULL, sfx_emfind);
} }
static void ST_doItemFinderIconsAndSound(void) static boolean ST_doItemFinderIconsAndSound(void)
{ {
INT32 emblems[16]; INT32 emblems[16];
thinker_t *th; thinker_t *th;
@ -2556,6 +2556,12 @@ static void ST_doItemFinderIconsAndSound(void)
INT32 interval = 0, newinterval = 0; INT32 interval = 0, newinterval = 0;
INT32 soffset; INT32 soffset;
if (!(cv_itemfinder.value && M_SecretUnlocked(SECRET_ITEMFINDER, clientGamedata)))
{
// Not unlocked, or not enabled. Use emerald hunt radar.
return false;
}
for (i = 0; i < numemblems; ++i) for (i = 0; i < numemblems; ++i)
{ {
if (emblemlocations[i].type > ET_SKIN || emblemlocations[i].level != gamemap) if (emblemlocations[i].type > ET_SKIN || emblemlocations[i].level != gamemap)
@ -2573,7 +2579,10 @@ static void ST_doItemFinderIconsAndSound(void)
} }
// Found all/none exist? Don't waste our time // Found all/none exist? Don't waste our time
if (!stunfound) if (!stunfound)
return; {
// Allow emerald hunt radar to function after they're all collected.
return false;
}
// Scan thinkers to find emblem mobj with these ids // Scan thinkers to find emblem mobj with these ids
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
@ -2607,6 +2616,8 @@ static void ST_doItemFinderIconsAndSound(void)
if (!(P_AutoPause() || paused) && interval > 0 && leveltime && leveltime % interval == 0 && renderisnewtic) if (!(P_AutoPause() || paused) && interval > 0 && leveltime && leveltime % interval == 0 && renderisnewtic)
S_StartSound(NULL, sfx_emfind); S_StartSound(NULL, sfx_emfind);
return true;
} }
// //
@ -2725,9 +2736,7 @@ static void ST_overlayDrawer(void)
ST_drawRaceHUD(); ST_drawRaceHUD();
// Emerald Hunt Indicators // Emerald Hunt Indicators
if (cv_itemfinder.value && M_SecretUnlocked(SECRET_ITEMFINDER, clientGamedata)) if (!ST_doItemFinderIconsAndSound());
ST_doItemFinderIconsAndSound();
else
ST_doHuntIconsAndSound(); ST_doHuntIconsAndSound();
if(!P_IsLocalPlayer(stplyr)) if(!P_IsLocalPlayer(stplyr))