From ef09f136d4522698f1bdf3417bb30dda94bc7181 Mon Sep 17 00:00:00 2001 From: smallmodel <15067410+smallmodel@users.noreply.github.com> Date: Fri, 18 Oct 2024 23:15:59 +0200 Subject: [PATCH] Fix sound indexes not erased correctly --- code/fgame/entity.cpp | 2 +- code/fgame/g_public.h | 12 ++++++------ code/server/sv_game.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/fgame/entity.cpp b/code/fgame/entity.cpp index 37a950b91..49dc0024b 100644 --- a/code/fgame/entity.cpp +++ b/code/fgame/entity.cpp @@ -6413,7 +6413,7 @@ void Entity::PlayNonPvsSound(const str& soundName, float volume) if (name.length() && ret) { nonpvs_sound_t* npvs = &edict->r.nonpvs_sounds[edict->r.num_nonpvs_sounds]; - npvs->index = gi.soundindex(name.c_str(), ret->streamed); + npvs->index = gi.pvssoundindex(name.c_str(), ret->streamed); npvs->volume = G_Random() * ret->volumeMod + ret->volume * volume; npvs->minDist = ret->dist; npvs->maxDist = ret->maxDist; diff --git a/code/fgame/g_public.h b/code/fgame/g_public.h index f3023b65d..33bcb5424 100644 --- a/code/fgame/g_public.h +++ b/code/fgame/g_public.h @@ -461,6 +461,12 @@ typedef struct gameImport_s { void (*HudDrawFont)(int info, const char *fontName); qboolean (*SanitizeName)(const char *oldName, char *newName); + // + // Added in OPM + // + + int (*pvssoundindex)(const char* name, int streamed); + cvar_t *fsDebug; // @@ -532,12 +538,6 @@ typedef struct gameExport_s { void (*SetFrameNumber)(int frameNumber); void (*SoundCallback)(int entNum, soundChannel_t channelNumber, const char *name); - // - // Added in OPM - // - - int (*pvssoundindex)(const char* name, int streamed); - // // global variables shared between game and server // diff --git a/code/server/sv_game.c b/code/server/sv_game.c index d6b506519..258722ff7 100644 --- a/code/server/sv_game.c +++ b/code/server/sv_game.c @@ -1803,7 +1803,7 @@ void SV_InitGameProgs( void ) { import.fsDebug = fs_debug; // Added in OPM - import.soundindex = SV_PVSSoundIndex; + import.pvssoundindex = SV_PVSSoundIndex; ge = Sys_GetGameAPI( &import );