- fixed sound listener angle for the remote control case.

It was taking the angle of the rotating sector object instead of the angle from the listener's position to it.
This commit is contained in:
Christoph Oelckers 2021-12-13 13:24:33 +01:00
parent 498abf25f3
commit 8abd67a3b1

View file

@ -597,7 +597,18 @@ void GameInterface::UpdateSounds(void)
PLAYERp pp = Player + screenpeek;
SoundListener listener;
listener.angle = float(-pp->angle.ang.asbuild() * BAngRadian); // Build uses a period of 2048.
binangle tang;
if (pp->sop_remote)
{
auto rsp = &pp->remoteActor->s();
if (TEST_BOOL1(rsp))
tang = buildang(rsp->ang);
else
tang = bvectangbam(pp->sop_remote->xmid - pp->posx, pp->sop_remote->ymid - pp->posy);
}
else tang = pp->angle.ang;
listener.angle = float(-tang.asbuild() * BAngRadian); // Build uses a period of 2048.
listener.velocity.Zero();
listener.position = GetSoundPos(&pp->pos);
listener.underwater = false;