G_TickTimeStickerMedals: Move the failed-record sound handling out of K_drawKartTimestamp

This commit is contained in:
toaster 2023-02-05 18:17:39 +00:00
parent 9c95d2d975
commit eb16f9d5a9
4 changed files with 22 additions and 7 deletions

View file

@ -565,6 +565,22 @@ bademblem:
} }
} }
void G_TickTimeStickerMedals(void)
{
if (players[consoleplayer].realtime > stickermedalinfo.timetoreach)
{
if (stickermedalinfo.norecord == false)
{
S_StartSound(NULL, sfx_s3k72); //sfx_s26d); -- you STOLE fizzy lifting drinks
stickermedalinfo.norecord = true;
}
}
else
{
stickermedalinfo.norecord = false;
}
}
// //
// G_UpdateRecords // G_UpdateRecords
// //

View file

@ -205,7 +205,7 @@ void G_EndGame(void); // moved from y_inter.c/h and renamed
extern struct stickermedalinfo extern struct stickermedalinfo
{ {
UINT8 visiblecount; UINT8 visiblecount;
boolean canplaysound; boolean norecord;
tic_t timetoreach; tic_t timetoreach;
emblem_t *emblems[MAXMEDALVISIBLECOUNT]; emblem_t *emblems[MAXMEDALVISIBLECOUNT];
emblem_t *regenemblem; emblem_t *regenemblem;
@ -213,6 +213,7 @@ extern struct stickermedalinfo
} stickermedalinfo; } stickermedalinfo;
void G_UpdateTimeStickerMedals(UINT16 map); void G_UpdateTimeStickerMedals(UINT16 map);
void G_TickTimeStickerMedals(void);
void G_UpdateRecords(void); void G_UpdateRecords(void);
void G_Ticker(boolean run); void G_Ticker(boolean run);

View file

@ -1562,14 +1562,9 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, UINT8 mode)
{ {
if (!mode) if (!mode)
{ {
if (stplyr->realtime > stickermedalinfo.timetoreach) if (stickermedalinfo.norecord == true)
{ {
splitflags = (splitflags &~ V_HUDTRANS)|V_HUDTRANSHALF; splitflags = (splitflags &~ V_HUDTRANS)|V_HUDTRANSHALF;
if (stickermedalinfo.canplaysound)
{
S_StartSound(NULL, sfx_s3k72); //sfx_s26d); -- you STOLE fizzy lifting drinks
stickermedalinfo.canplaysound = false;
}
} }
} }

View file

@ -766,7 +766,10 @@ void P_Ticker(boolean run)
} }
if (modeattacking) if (modeattacking)
{
G_GhostTicker(); G_GhostTicker();
G_TickTimeStickerMedals();
}
if (mapreset > 1 if (mapreset > 1
&& --mapreset <= 1 && --mapreset <= 1