Catch all other instances of sounds which might have played where R_CanShowSkinInDemo is false

- Tally
- Generic S_StartSound call (where sfx_id is in skinsound region)
This commit is contained in:
toaster 2024-03-26 15:03:05 +00:00 committed by James R.
parent b7927fc7a4
commit 75b4bdd4ea
2 changed files with 9 additions and 3 deletions

View file

@ -517,13 +517,17 @@ void level_tally_t::Init(player_t *player)
{ {
// It'd be neat to add all of the grade sounds, // It'd be neat to add all of the grade sounds,
// but not this close to release // but not this close to release
if (rank < GRADE_C)
UINT8 skinid = player->skin;
if (skinid >= numskins || R_CanShowSkinInDemo(skinid) == false)
;
else if (rank < GRADE_C)
{ {
gradeVoice = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_klose].skinsound]; gradeVoice = skins[skinid].soundsid[S_sfx[sfx_klose].skinsound];
} }
else else
{ {
gradeVoice = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_kwin].skinsound]; gradeVoice = skins[skinid].soundsid[S_sfx[sfx_kwin].skinsound];
} }
} }

View file

@ -502,6 +502,8 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
{ {
// redirect player sound to the sound in the skin table // redirect player sound to the sound in the skin table
skin_t *skin = (origin->player ? &skins[origin->player->skin] : ((skin_t *)origin->skin)); skin_t *skin = (origin->player ? &skins[origin->player->skin] : ((skin_t *)origin->skin));
if (R_CanShowSkinInDemo(skin-skins) == false)
return;
sfx_id = skin->soundsid[sfx->skinsound]; sfx_id = skin->soundsid[sfx->skinsound];
sfx = &S_sfx[sfx_id]; sfx = &S_sfx[sfx_id];
} }