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:
Sal 2018-11-26 08:02:26 -05:00
commit 159d8040b8
2 changed files with 3 additions and 1 deletions

View file

@ -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,
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)
continue;
else if (dist < 160<<FRACBITS) // engine sounds' approx. range

View file

@ -1199,7 +1199,7 @@ fixed_t S_CalculateSoundDistance(fixed_t sx1, fixed_t sy1, fixed_t sz1, fixed_t
approx_dist <<= FRACBITS;
return approx_dist;
return FixedDiv(approx_dist, mapheaderinfo[gamemap-1]->mobj_scale); // approx_dist
}
//