File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Client/mods/deathmatch/logic Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -350,17 +350,15 @@ void CClientSoundManager::UpdateDistanceStreaming(const CVector& vecListenerPosi
350350 // If the sound is more than 40 units away (or in another dimension), make sure it is deactivated
351351 // If the sound is less than 20 units away, make sure it is activated
352352 //
353- for (std::set< CClientSound*>::iterator iter = considerMap. begin (); iter != considerMap. end (); ++iter )
353+ for (CClientSound* pSound : considerMap)
354354 {
355- CClientSound* pSound = *iter;
356-
357355 // Calculate distance to the edge of the sphere
358356 CSphere sphere = pSound->GetWorldBoundingSphere ();
359357 float fDistance = (vecListenerPosition - sphere.vecPosition ).Length () - sphere.fRadius ;
360358
361- if (fDistance > 40 || m_usDimension != pSound->GetDimension ())
359+ if (( fDistance > 40 || m_usDimension != pSound->GetDimension () && MapContains (m_DistanceStreamedInMap, pSound) ))
362360 pSound->DistanceStreamOut ();
363- else if (fDistance < 20 )
361+ else if (fDistance < 20 )
364362 pSound->DistanceStreamIn ();
365363 }
366364}
You can’t perform that action at this time.
0 commit comments