Okay do this correctly by doing a reacharound to grab the actual sfx id

This commit is contained in:
TehRealSalt 2018-09-07 16:56:34 -04:00
parent f907a3c215
commit 6317ae5996
2 changed files with 22 additions and 5 deletions

View file

@ -1730,10 +1730,27 @@ void P_DoPlayerExit(player_t *player)
if (cv_kartvoices.value && P_IsLocalPlayer(player))
{
if (K_IsPlayerLosing(player))
S_StartSound(player->mo, sfx_klose);
if (P_IsLocalPlayer(player))
{
sfxenum_t sfx_id;
if (K_IsPlayerLosing(player))
{
sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_klose].skinsound];
S_StartSound(NULL, sfx_id);
}
else
{
sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_kwin].skinsound];
S_StartSound(NULL, sfx_id);
}
}
else
S_StartSound(player->mo, sfx_kwin);
{
if (K_IsPlayerLosing(player))
S_StartSound(player->mo, sfx_klose);
else
S_StartSound(player->mo, sfx_kwin);
}
}
player->exiting = 3*TICRATE;

View file

@ -814,8 +814,8 @@ sfxinfo_t S_sfx[NUMSFX] =
{"dbgsal", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
// SRB2kart - Skin sounds
{"kwin", false, 64, 48, -1, NULL, 0, SKSKWIN, -1, LUMPERROR},
{"klose", false, 64, 48, -1, NULL, 0, SKSKLOSE, -1, LUMPERROR},
{"kwin", false, 64, 96, -1, NULL, 0, SKSKWIN, -1, LUMPERROR},
{"klose", false, 64, 96, -1, NULL, 0, SKSKLOSE, -1, LUMPERROR},
{"khurt1", false, 64, 96, -1, NULL, 0, SKSKPAN1, -1, LUMPERROR},
{"khurt2", false, 64, 96, -1, NULL, 0, SKSKPAN2, -1, LUMPERROR},
{"kattk1", false, 64, 96, -1, NULL, 0, SKSKATK1, -1, LUMPERROR},