- 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.
This commit is contained in:
Christoph Oelckers 2016-04-04 12:46:32 +02:00
parent fadc7d650d
commit 32c32ea739

View file

@ -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);
}