mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
S_StartSoundAtVolume, K_PlayPainSound, K_PlayHitEmSound: Use user skin for sounds instead of mobj skin
So we'll always hear the clips we pick for Heavy Magician
This commit is contained in:
parent
3c79e32516
commit
0606fb50ba
2 changed files with 7 additions and 5 deletions
|
|
@ -2515,8 +2515,8 @@ void K_PlayOvertakeSound(mobj_t *source)
|
||||||
void K_PlayPainSound(mobj_t *source, mobj_t *other)
|
void K_PlayPainSound(mobj_t *source, mobj_t *other)
|
||||||
{
|
{
|
||||||
sfxenum_t pick = P_RandomKey(PR_VOICES, 2); // Gotta roll the RNG every time this is called for sync reasons
|
sfxenum_t pick = P_RandomKey(PR_VOICES, 2); // Gotta roll the RNG every time this is called for sync reasons
|
||||||
|
skin_t *skin = (source->player ? &skins[source->player->skin] : ((skin_t *)source->skin));
|
||||||
sfxenum_t sfx_id = ((skin_t *)source->skin)->soundsid[S_sfx[sfx_khurt1 + pick].skinsound];
|
sfxenum_t sfx_id = skin->soundsid[S_sfx[sfx_khurt1 + pick].skinsound];
|
||||||
boolean alwaysHear = false;
|
boolean alwaysHear = false;
|
||||||
|
|
||||||
if (other != NULL && P_MobjWasRemoved(other) == false && other->player != NULL)
|
if (other != NULL && P_MobjWasRemoved(other) == false && other->player != NULL)
|
||||||
|
|
@ -2534,7 +2534,8 @@ void K_PlayPainSound(mobj_t *source, mobj_t *other)
|
||||||
|
|
||||||
void K_PlayHitEmSound(mobj_t *source, mobj_t *other)
|
void K_PlayHitEmSound(mobj_t *source, mobj_t *other)
|
||||||
{
|
{
|
||||||
sfxenum_t sfx_id = ((skin_t *)source->skin)->soundsid[S_sfx[sfx_khitem].skinsound];
|
skin_t *skin = (source->player ? &skins[source->player->skin] : ((skin_t *)source->skin));
|
||||||
|
sfxenum_t sfx_id = skin->soundsid[S_sfx[sfx_khitem].skinsound];
|
||||||
boolean alwaysHear = false;
|
boolean alwaysHear = false;
|
||||||
|
|
||||||
if (other != NULL && P_MobjWasRemoved(other) == false && other->player != NULL)
|
if (other != NULL && P_MobjWasRemoved(other) == false && other->player != NULL)
|
||||||
|
|
|
||||||
|
|
@ -600,10 +600,11 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
|
||||||
|
|
||||||
sfx = &S_sfx[sfx_id];
|
sfx = &S_sfx[sfx_id];
|
||||||
|
|
||||||
if (sfx->skinsound != -1 && origin && origin->skin)
|
if (sfx->skinsound != -1 && origin && (origin->player || origin->skin))
|
||||||
{
|
{
|
||||||
// redirect player sound to the sound in the skin table
|
// redirect player sound to the sound in the skin table
|
||||||
sfx_id = ((skin_t *)origin->skin)->soundsid[sfx->skinsound];
|
skin_t *skin = (origin->player ? &skins[origin->player->skin] : ((skin_t *)origin->skin));
|
||||||
|
sfx_id = skin->soundsid[sfx->skinsound];
|
||||||
sfx = &S_sfx[sfx_id];
|
sfx = &S_sfx[sfx_id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue