mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'bot-muffler' into 'master'
Don't force player sounds to full volume when exiting See merge request KartKrew/Kart!1615
This commit is contained in:
commit
9134e6a4e7
4 changed files with 18 additions and 4 deletions
|
|
@ -12630,4 +12630,10 @@ void K_SetTireGrease(player_t *player, tic_t tics)
|
|||
player->tiregrease = tics;
|
||||
}
|
||||
|
||||
// somewhat sensible check for HUD sounds in a post-bot-takeover world
|
||||
boolean K_IsPlayingDisplayPlayer(player_t *player)
|
||||
{
|
||||
return P_IsDisplayPlayer(player) && (!player->exiting);
|
||||
}
|
||||
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -243,6 +243,8 @@ boolean K_isPlayerInSpecialState(player_t *p);
|
|||
|
||||
void K_SetTireGrease(player_t *player, tic_t tics);
|
||||
|
||||
boolean K_IsPlayingDisplayPlayer(player_t *player);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1633,7 +1633,7 @@ void K_KartItemRoulette(player_t *const player, ticcmd_t *const cmd)
|
|||
//player->karthud[khud_itemblinkmode] = 1;
|
||||
//player->karthud[khud_rouletteoffset] = K_GetRouletteOffset(roulette, FRACUNIT);
|
||||
|
||||
if (P_IsDisplayPlayer(player))
|
||||
if (K_IsPlayingDisplayPlayer(player))
|
||||
{
|
||||
S_StartSound(NULL, sfx_itrole);
|
||||
}
|
||||
|
|
@ -1680,7 +1680,7 @@ void K_KartItemRoulette(player_t *const player, ticcmd_t *const cmd)
|
|||
player->karthud[khud_itemblinkmode] = 0;
|
||||
player->karthud[khud_rouletteoffset] = K_GetRouletteOffset(roulette, FRACUNIT);
|
||||
|
||||
if (P_IsDisplayPlayer(player))
|
||||
if (K_IsPlayingDisplayPlayer(player))
|
||||
{
|
||||
if (roulette->ringbox)
|
||||
{
|
||||
|
|
@ -1714,7 +1714,7 @@ void K_KartItemRoulette(player_t *const player, ticcmd_t *const cmd)
|
|||
// This makes the roulette produce the random noises.
|
||||
roulette->sound = (roulette->sound + 1) % 8;
|
||||
|
||||
if (P_IsDisplayPlayer(player))
|
||||
if (K_IsPlayingDisplayPlayer(player))
|
||||
{
|
||||
if (roulette->ringbox)
|
||||
S_StartSound(NULL, sfx_s240);
|
||||
|
|
|
|||
|
|
@ -426,6 +426,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
|
|||
for (i = 0; i <= r_splitscreen; i++)
|
||||
{
|
||||
player_t *player = &players[displayplayers[i]];
|
||||
boolean camaway = false;
|
||||
|
||||
memset(&listener[i], 0, sizeof (listener[i]));
|
||||
listenmobj[i] = NULL;
|
||||
|
|
@ -442,9 +443,11 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
|
|||
else
|
||||
{
|
||||
listenmobj[i] = player->mo;
|
||||
if (player->exiting)
|
||||
camaway = true;
|
||||
}
|
||||
|
||||
if (origin && origin == listenmobj[i] && !camera[i].freecam)
|
||||
if (origin && origin == listenmobj[i] && !camera[i].freecam && !camaway)
|
||||
{
|
||||
itsUs = true;
|
||||
}
|
||||
|
|
@ -763,6 +766,9 @@ void S_UpdateSounds(void)
|
|||
if (c->origin != listenmobj[i])
|
||||
continue;
|
||||
|
||||
if (listenmobj[i]->player && listenmobj[i]->player->exiting)
|
||||
continue;
|
||||
|
||||
itsUs = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue