If the loopSound has no origin, make it local

This should fix #309
This commit is contained in:
smallmodel 2024-06-15 16:38:02 +02:00
parent bbb54ea36d
commit f5aadbb788
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "../snd_local.h"
#include "../client.h"
#if !defined(USE_SOUND_NEW) || !USE_SOUND_NEW
@ -57,6 +58,13 @@ void S_AddLoopingSound(const vec3_t origin, const vec3_t velocity, sfxHandle_t s
}
// FIXME: unimplemented
if (VectorCompare(origin, vec3_origin)) {
// Consider it to be a local sound, uses the player origin
S_AddLoopingSound(cl.snap.ps.clientNum, cl.snap.ps.origin, velocity, sfxHandle);
return;
}
S_AddLoopingSound(ENTITYNUM_WORLD, origin, velocity, sfxHandle);
}