diff options
| author | untodesu <kirill@untode.su> | 2025-03-27 13:28:09 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-03-27 13:28:09 +0500 |
| commit | 60cb5a829b54732176936e21511aa5372ae46fab (patch) | |
| tree | a2d671ea8d19607042e3177ec0bb50d69f6f85a8 /game/client/factory.cc | |
| parent | b2d4a09a5621e214636593641d9799b2b1cdcf72 (diff) | |
| download | voxelius-60cb5a829b54732176936e21511aa5372ae46fab.tar.bz2 voxelius-60cb5a829b54732176936e21511aa5372ae46fab.zip | |
Allow game to not die when sound is not available
Diffstat (limited to 'game/client/factory.cc')
| -rw-r--r-- | game/client/factory.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/game/client/factory.cc b/game/client/factory.cc index 636cf35..5eca00c 100644 --- a/game/client/factory.cc +++ b/game/client/factory.cc @@ -6,6 +6,7 @@ #include "shared/head.hh" #include "shared/transform.hh" +#include "client/globals.hh" #include "client/sound_emitter.hh" void client_factory::create_player(Dimension *dimension, entt::entity entity) @@ -20,5 +21,7 @@ void client_factory::create_player(Dimension *dimension, entt::entity entity) dimension->entities.emplace_or_replace<TransformComponentIntr>(entity, transform); dimension->entities.emplace_or_replace<TransformComponentPrev>(entity, transform); - dimension->entities.emplace_or_replace<SoundEmitterComponent>(entity); + if(globals::sound_ctx) { + dimension->entities.emplace_or_replace<SoundEmitterComponent>(entity); + } } |
