diff options
Diffstat (limited to 'game/client/sound_effect.cc')
| -rw-r--r-- | game/client/sound_effect.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/game/client/sound_effect.cc b/game/client/sound_effect.cc index c6cee72..4e01e8c 100644 --- a/game/client/sound_effect.cc +++ b/game/client/sound_effect.cc @@ -3,6 +3,8 @@ #include "core/resource.hh" +#include "client/globals.hh" + static emhash8::HashMap<std::string, resource_ptr<SoundEffect>> resource_map; static std::size_t drwav_read_physfs(void *file, void *output, std::size_t count) @@ -27,6 +29,11 @@ resource_ptr<SoundEffect> resource::load<SoundEffect>(const char *name, unsigned return it->second; } + if(globals::sound_ctx == nullptr) { + // Sound is disabled + return nullptr; + } + auto file = PHYSFS_openRead(name); if(file == nullptr) { |
