mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-21 19:31:04 +00:00
Engine tweak
This commit is contained in:
parent
6a0b1526b9
commit
c4d1b80e97
1 changed files with 13 additions and 22 deletions
35
src/k_kart.c
35
src/k_kart.c
|
@ -3690,31 +3690,22 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd)
|
||||||
if (player->kartstuff[k_enginesnd] > 12)
|
if (player->kartstuff[k_enginesnd] > 12)
|
||||||
player->kartstuff[k_enginesnd] = 12;
|
player->kartstuff[k_enginesnd] = 12;
|
||||||
|
|
||||||
// Display player's engines are quieter
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
if ((player == &players[displayplayer])
|
|
||||||
|| (player == &players[secondarydisplayplayer] && splitscreen)
|
|
||||||
|| (player == &players[thirddisplayplayer] && splitscreen > 1)
|
|
||||||
|| (player == &players[fourthdisplayplayer] && splitscreen > 2))
|
|
||||||
volume = FixedDiv(volume<<FRACBITS, FixedSqrt(((splitscreen+1)*3)<<FRACBITS))>>FRACBITS;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
if (!playeringame[i] || !players[i].mo || players[i].spectator || players[i].exiting)
|
||||||
{
|
continue;
|
||||||
if (!playeringame[i] || !players[i].mo || players[i].spectator || players[i].exiting)
|
if (((i == displayplayer)
|
||||||
continue;
|
|| (i == secondarydisplayplayer && splitscreen)
|
||||||
if ((i == displayplayer)
|
|| (i == thirddisplayplayer && splitscreen > 1)
|
||||||
|| (i == secondarydisplayplayer && splitscreen)
|
|| (i == fourthdisplayplayer && splitscreen > 2))
|
||||||
|| (i == thirddisplayplayer && splitscreen > 1)
|
|| (P_AproxDistance(P_AproxDistance(player->mo->x-players[i].mo->x,
|
||||||
|| (i == fourthdisplayplayer && splitscreen > 2))
|
player->mo->y-players[i].mo->y), player->mo->z-players[i].mo->z) <= 3072<<FRACBITS)) // engine sounds' approx. range
|
||||||
continue;
|
numcloseplayers++;
|
||||||
if (P_AproxDistance(P_AproxDistance(player->mo->x-players[i].mo->x,
|
|
||||||
player->mo->y-players[i].mo->y), player->mo->z-players[i].mo->z) <= 3072<<FRACBITS) // engine sounds' approx. range
|
|
||||||
numcloseplayers++;
|
|
||||||
}
|
|
||||||
if (numcloseplayers > 1)
|
|
||||||
volume = FixedDiv(volume<<FRACBITS, FixedSqrt(numcloseplayers<<FRACBITS))>>FRACBITS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (numcloseplayers > 1)
|
||||||
|
volume /= numcloseplayers;
|
||||||
|
|
||||||
S_StartSoundAtVolume(player->mo, (sfx_krta00 + player->kartstuff[k_enginesnd]) + (class*numsnds), volume);
|
S_StartSoundAtVolume(player->mo, (sfx_krta00 + player->kartstuff[k_enginesnd]) + (class*numsnds), volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue