From 60cb5a829b54732176936e21511aa5372ae46fab Mon Sep 17 00:00:00 2001 From: untodesu Date: Thu, 27 Mar 2025 13:28:09 +0500 Subject: Allow game to not die when sound is not available --- game/client/factory.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'game/client/factory.cc') 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(entity, transform); dimension->entities.emplace_or_replace(entity, transform); - dimension->entities.emplace_or_replace(entity); + if(globals::sound_ctx) { + dimension->entities.emplace_or_replace(entity); + } } -- cgit