mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'sounddistfix' into 'master'
Sound volume distance indication now scales with mapheader scale. See merge request KartKrew/Kart!105
This commit is contained in:
commit
41e04a4fff
2 changed files with 3 additions and 1 deletions
|
|
@ -3966,6 +3966,8 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd)
|
||||||
dist = P_AproxDistance(P_AproxDistance(player->mo->x-players[i].mo->x,
|
dist = 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) / 2;
|
player->mo->y-players[i].mo->y), player->mo->z-players[i].mo->z) / 2;
|
||||||
|
|
||||||
|
dist = FixedDiv(dist, mapheaderinfo[gamemap-1]->mobj_scale);
|
||||||
|
|
||||||
if (dist > 1536<<FRACBITS)
|
if (dist > 1536<<FRACBITS)
|
||||||
continue;
|
continue;
|
||||||
else if (dist < 160<<FRACBITS) // engine sounds' approx. range
|
else if (dist < 160<<FRACBITS) // engine sounds' approx. range
|
||||||
|
|
|
||||||
|
|
@ -1199,7 +1199,7 @@ fixed_t S_CalculateSoundDistance(fixed_t sx1, fixed_t sy1, fixed_t sz1, fixed_t
|
||||||
|
|
||||||
approx_dist <<= FRACBITS;
|
approx_dist <<= FRACBITS;
|
||||||
|
|
||||||
return approx_dist;
|
return FixedDiv(approx_dist, mapheaderinfo[gamemap-1]->mobj_scale); // approx_dist
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue