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);
}
static void ST_doItemFinderIconsAndSound(void)
static boolean ST_doItemFinderIconsAndSound(void)
{
INT32 emblems[16];
thinker_t *th;
@ -2556,6 +2556,12 @@ static void ST_doItemFinderIconsAndSound(void)
INT32 interval = 0, newinterval = 0;
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)
{
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
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
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)
S_StartSound(NULL, sfx_emfind);
return true;
}
//
@ -2725,9 +2736,7 @@ static void ST_overlayDrawer(void)
ST_drawRaceHUD();
// Emerald Hunt Indicators
if (cv_itemfinder.value && M_SecretUnlocked(SECRET_ITEMFINDER, clientGamedata))
ST_doItemFinderIconsAndSound();
else
if (!ST_doItemFinderIconsAndSound());
ST_doHuntIconsAndSound();
if(!P_IsLocalPlayer(stplyr))