Skip to content

Commit

Permalink
Fix sound indexes not erased correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
smallmodel committed Oct 18, 2024
1 parent 6136bbd commit ef09f13
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion code/fgame/entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions code/fgame/g_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

//
Expand Down Expand Up @@ -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
//
Expand Down
2 changes: 1 addition & 1 deletion code/server/sv_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down

0 comments on commit ef09f13

Please sign in to comment.