♻️ Replace Point addition with 'Point + Displacement'

This commit is contained in:
Juliano Leal Goncalves 2021-06-28 01:02:24 -03:00 committed by Anders Jenbo
commit cbb84199c2
23 changed files with 264 additions and 272 deletions

View file

@ -1151,7 +1151,7 @@ bool calc_snd_position(Point soundPosition, int *plVolume, int *plPan)
const auto &playerPosition = plr[myplr].position.tile;
const auto delta = soundPosition - playerPosition;
pan = (delta.x - delta.y) * 256;
pan = (delta.deltaX - delta.deltaY) * 256;
*plPan = clamp(pan, PAN_MIN, PAN_MAX);
volume = playerPosition.ApproxDistance(soundPosition);