Fix sound indexes not erased correctly

This commit is contained in:
smallmodel 2024-10-18 23:15:59 +02:00
parent 6136bbd019
commit ef09f136d4
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
3 changed files with 8 additions and 8 deletions

View file

@ -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;

View file

@ -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
//

View file

@ -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 );