Skip to content

Commit 56fc5b4

Browse files
authored
Merge pull request #6352 from Goober5000/allow_explicitly_empty_sounds
allow explicitly empty sounds
2 parents 461c628 + b596fa3 commit 56fc5b4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

code/gamesnd/gamesnd.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ void parse_gamesnd_old(game_snd* gs)
654654
{
655655
entry.filename[0] = 0;
656656
advance_to_eoln(nullptr);
657-
gs->flags |= GAME_SND_NOT_VALID;
657+
gs->flags |= (GAME_SND_NOT_VALID | GAME_SND_EXPLICITLY_EMPTY);
658658
return;
659659
}
660660
Mp++;
@@ -883,7 +883,7 @@ void parse_gamesnd_new(game_snd* gs, bool no_create)
883883
if (!stricmp(name, NOX("empty")) || !stricmp(name, NOX("none")))
884884
{
885885
entry->filename[0] = 0;
886-
gs->flags |= GAME_SND_NOT_VALID;
886+
gs->flags |= (GAME_SND_NOT_VALID | GAME_SND_EXPLICITLY_EMPTY);
887887
return;
888888
}
889889

@@ -965,7 +965,7 @@ void parse_gamesnd_new(game_snd* gs, bool no_create)
965965

966966
bool gamesnd_is_placeholder(const game_snd& gs)
967967
{
968-
return gs.sound_entries.empty() || gs.sound_entries[0].filename[0] == '\0';
968+
return (gs.sound_entries.empty() || gs.sound_entries[0].filename[0] == '\0') && !(gs.flags & GAME_SND_EXPLICITLY_EMPTY);
969969
}
970970

971971
void gamesnd_parse_entry(game_snd *gs, bool &orig_no_create, SCP_vector<game_snd> *lookupVector, size_t lookupVectorMaxIndexableSize, bool (*is_reserved_index)(int))

code/sound/sound.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#define GAME_SND_NOT_VALID (1<<2)
2727
#define GAME_SND_PRELOAD (1<<3) //!< preload sound (ie read from disk before mission starts)
2828
#define GAME_SND_RETAIL_STYLE (1<<4)
29+
#define GAME_SND_EXPLICITLY_EMPTY (1<<5) // a sound that has been parsed as empty
2930

3031
// Priorities that can be passed to snd_play() functions to limit how many concurrent sounds of a
3132
// given type are played.

0 commit comments

Comments
 (0)