Fix #2299 (audio issues in minigolf end): the listener position was

not set at all anymore when an end camera was used.
This commit is contained in:
hiker 2015-09-01 09:43:01 +10:00
parent da848a4c72
commit d6319f77d5

View File

@ -433,12 +433,6 @@ void Camera::smoothMoveCamera(float dt)
assert(!isnan(m_camera->getPosition().Y));
assert(!isnan(m_camera->getPosition().Z));
if (race_manager->getNumLocalPlayers() < 2)
{
SFXManager::get()->positionListener(current_position,
current_target - current_position,
Vec3(0,1,0));
}
} // smoothMoveCamera
//-----------------------------------------------------------------------------
@ -530,6 +524,14 @@ void Camera::getCameraSettings(float *above_kart, float *cam_angle,
*/
void Camera::update(float dt)
{
if (race_manager->getNumLocalPlayers() < 2)
{
Vec3 pos(m_camera->getPosition());
SFXManager::get()->positionListener(pos,
Vec3(m_camera->getTarget()) - pos,
Vec3(0, 1, 0));
}
if (m_kart == NULL) return; // cameras not attached to kart must be positioned manually
float above_kart, cam_angle, side_way, distance;