From 3a6123fe36d6c16aba08615077ea8203ae08daf8 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Thu, 11 Apr 2024 08:29:49 -0700 Subject: [PATCH] fix console sound (#1547) --- dScripts/02_server/Map/General/TokenConsoleServer.cpp | 4 +++- dScripts/02_server/Map/NS/NsTokenConsoleServer.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dScripts/02_server/Map/General/TokenConsoleServer.cpp b/dScripts/02_server/Map/General/TokenConsoleServer.cpp index e13011cb..0a1f679c 100644 --- a/dScripts/02_server/Map/General/TokenConsoleServer.cpp +++ b/dScripts/02_server/Map/General/TokenConsoleServer.cpp @@ -17,7 +17,9 @@ void TokenConsoleServer::OnUse(Entity* self, Entity* user) { inv->RemoveItem(6194, bricksToTake); //play sound - GameMessages::SendPlayNDAudioEmitter(self, user->GetSystemAddress(), "947d0d52-c7f8-4516-8dee-e1593a7fd1d1"); + if (self->HasVar(u"sound1")) { + GameMessages::SendPlayNDAudioEmitter(self, user->GetSystemAddress(), self->GetVarAsString(u"sound1")); + } //figure out which faction the player belongs to: auto character = user->GetCharacter(); diff --git a/dScripts/02_server/Map/NS/NsTokenConsoleServer.cpp b/dScripts/02_server/Map/NS/NsTokenConsoleServer.cpp index 74542f9f..7d825828 100644 --- a/dScripts/02_server/Map/NS/NsTokenConsoleServer.cpp +++ b/dScripts/02_server/Map/NS/NsTokenConsoleServer.cpp @@ -39,7 +39,7 @@ void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) { const auto useSound = self->GetVar(u"sound1"); if (!useSound.empty()) { - GameMessages::SendPlayNDAudioEmitter(self, UNASSIGNED_SYSTEM_ADDRESS, useSound); + GameMessages::SendPlayNDAudioEmitter(self, user->GetSystemAddress(), useSound); } // Player must be in faction to interact with this entity.