From 32c32ea73912ed19c1687e2ab6498eee92af62d0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 4 Apr 2016 12:46:32 +0200 Subject: [PATCH] - fixed some initialization problems with sound. * a position-less sound did not get the listener's position attached. * an unattached sound mixed up y and z coordinates. --- src/s_sound.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/s_sound.cpp b/src/s_sound.cpp index c7ac7cebc5..d1fee071e5 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -665,6 +665,7 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector, if (listener != NULL) { listenpos = listener->Pos(); + *pos = listener->SoundPos(); pgroup = listener->Sector->PortalGroup; } else @@ -1276,7 +1277,8 @@ void S_Sound (const FPolyObj *poly, int channel, FSoundID sound_id, float volume void S_Sound(const DVector3 &pos, int channel, FSoundID sound_id, float volume, float attenuation) { - FVector3 p((float)pos.X, (float)pos.Y, (float)pos.Z); + // The sound system switches Y and Z around. + FVector3 p((float)pos.X, (float)pos.Z, (float)pos.Y); S_StartSound (NULL, NULL, NULL, &p, channel, sound_id, volume, attenuation); }