Skip to content

Commit

Permalink
track.cpp: Allow audio JSON files to override existing entries
Browse files Browse the repository at this point in the history
This permits, for example, a campaign mod to have a .wrf that loads the base audio.json AUDIOCFG followed by a custom audio-overrides.json AUDIOCFG that overrides the settings for select sound effects.
  • Loading branch information
past-due committed Apr 28, 2024
1 parent 1f8938a commit 39b0138
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sound/track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ unsigned int sound_SetTrackVals(const char *fileName, bool loop, unsigned int vo
ASSERT_OR_RETURN(0, trackID < g_apTrack.size(), "Invalid trackID: %u", trackID);
if (g_apTrack[trackID] != nullptr)
{
debug(LOG_ERROR, "sound_SetTrackVals: track %i already set (filename: \"%s\"\n", trackID, g_apTrack[trackID]->fileName);
return 0;
debug(LOG_SOUND, "sound_SetTrackVals: track %i already set (filename: \"%s\") - overriding", trackID, g_apTrack[trackID]->fileName);
ASSERT_OR_RETURN(0, psTrack == g_apTrack[trackID], "Data pointer not equal?");
}

// set track members
Expand Down

0 comments on commit 39b0138

Please sign in to comment.