mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-09 12:46:19 +00:00
Reset Invincibility (and Grow) music to the start if stacked
Toggleable via the resetspecialmusic cvar.
This commit is contained in:
parent
dd1715aa15
commit
7e0aa16e70
6 changed files with 19 additions and 4 deletions
|
|
@ -991,6 +991,8 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_respawnfademusicout);
|
||||
CV_RegisterVar(&cv_respawnfademusicback);
|
||||
|
||||
CV_RegisterVar(&cv_resetspecialmusic);
|
||||
|
||||
CV_RegisterVar(&cv_resume);
|
||||
|
||||
// ingame object placing
|
||||
|
|
|
|||
|
|
@ -536,6 +536,8 @@ consvar_t cv_growmusicfade = {"growmusicfade", "500", CV_SAVE, CV_Unsigned, NULL
|
|||
consvar_t cv_respawnfademusicout = {"respawnfademusicout", "1000", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_respawnfademusicback = {"respawnfademusicback", "500", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_resetspecialmusic = {"resetspecialmusic", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_resume = {"resume", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#if MAXPLAYERS > 16
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ extern consvar_t cv_growmusicfade;
|
|||
extern consvar_t cv_respawnfademusicout;
|
||||
extern consvar_t cv_respawnfademusicback;
|
||||
|
||||
extern consvar_t cv_resetspecialmusic;
|
||||
|
||||
extern consvar_t cv_resume;
|
||||
|
||||
typedef enum
|
||||
|
|
|
|||
|
|
@ -1247,15 +1247,13 @@ void P_RestoreMusic(player_t *player)
|
|||
// Item - Grow
|
||||
if (wantedmus == 2)
|
||||
{
|
||||
S_ChangeMusicInternal("kgrow", true);
|
||||
S_SetMusicUsage(MUS_SPECIAL);
|
||||
S_ChangeMusicSpecial("kgrow");
|
||||
S_SetRestoreMusicFadeInCvar(&cv_growmusicfade);
|
||||
}
|
||||
// Item - Invincibility
|
||||
else if (wantedmus == 1)
|
||||
{
|
||||
S_ChangeMusicInternal("kinvnc", true);
|
||||
S_SetMusicUsage(MUS_SPECIAL);
|
||||
S_ChangeMusicSpecial("kinvnc");
|
||||
S_SetRestoreMusicFadeInCvar(&cv_invincmusicfade);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -2075,6 +2075,15 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
S_ChangeMusicSpecial (const char *mmusic)
|
||||
{
|
||||
if (cv_resetspecialmusic.value)
|
||||
S_ChangeMusic(mmusic, MUSIC_FORCERESET, true);
|
||||
else
|
||||
S_ChangeMusicInternal(mmusic, true);
|
||||
}
|
||||
|
||||
void S_StopMusic(void)
|
||||
{
|
||||
if (!I_SongPlaying()
|
||||
|
|
|
|||
|
|
@ -192,6 +192,8 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
|||
#define S_ChangeMusicInternal(a,b) S_ChangeMusicEx(a,0,b,0,0,0)
|
||||
#define S_ChangeMusic(a,b,c) S_ChangeMusicEx(a,b,c,0,0,0)
|
||||
|
||||
void S_ChangeMusicSpecial (const char *mmusic);
|
||||
|
||||
void S_SetRestoreMusicFadeInCvar (consvar_t *cvar);
|
||||
#define S_ClearRestoreMusicFadeInCvar() \
|
||||
S_SetRestoreMusicFadeInCvar(0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue