diff --git a/source/blood/src/actor.cpp b/source/blood/src/actor.cpp index 76afe1a63..33ac5b4ec 100644 --- a/source/blood/src/actor.cpp +++ b/source/blood/src/actor.cpp @@ -4615,7 +4615,11 @@ void MoveDude(spritetype *pSprite) if (VanillaMode()) playerResetInertia(pPlayer); else + { playerCorrectInertia(pPlayer, &oldpos); + if (pPlayer == gMe) // if player is listener, update ear position so audio pitch of surrounding sfx does not freak out when transitioning between ror sectors + sfxCorrectListenerPos(); + } } switch (nLink) { case kMarkerLowStack: diff --git a/source/blood/src/sfx.cpp b/source/blood/src/sfx.cpp index 4145c2709..e3638760a 100644 --- a/source/blood/src/sfx.cpp +++ b/source/blood/src/sfx.cpp @@ -456,6 +456,17 @@ inline void sfxUpdateListenerVel(void) earVR = {earR.x - earR0.x, earR.y - earR0.y}; } +void sfxCorrectListenerPos(void) +{ + sfxUpdateListenerPos(); + earL0 = earL; + earR0 = earR; + earL0.x += -earVL.dx; + earL0.y += -earVL.dy; + earR0.x += -earVR.dx; + earR0.y += -earVR.dy; +} + void sfxResetListener(void) { sfxUpdateListenerPos(); // update ear position diff --git a/source/blood/src/sfx.h b/source/blood/src/sfx.h index 6218dcdc0..45c165194 100644 --- a/source/blood/src/sfx.h +++ b/source/blood/src/sfx.h @@ -51,6 +51,7 @@ void sfxPlay3DSoundCP(spritetype* pSprite, int soundId, int chanId = -1, int nFl void sfxKill3DSound(spritetype *pSprite, int chanId = -1, int soundId = -1); void sfxKillAllSounds(void); void sfxKillSpriteSounds(spritetype *pSprite); +void sfxCorrectListenerPos(void); void sfxResetListener(void); void sfxUpdate3DSounds(void); void sfxSetReverb(bool toggle);