From 46f2c0df8521f9d1d6ca6a7fdcfd5a60f7216bab Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 9 Mar 2026 16:01:29 -0700 Subject: [PATCH] Fix SoundEntries.dbc field indices for SMSG_PLAY_MUSIC and remove dead NpcVoiceManager code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correct SoundEntries.dbc field access in the PlayMusic callback: file names are at fields 3-12 (not 2-11) and DirectoryBase is at field 23 (not 22). Field 2 is the Name label string, not a file path. Remove dead detectVoiceType(creatureEntry) from NpcVoiceManager — it was never called; actual voice detection uses detectVoiceTypeFromDisplayId() in Application. --- include/audio/npc_voice_manager.hpp | 1 - src/audio/npc_voice_manager.cpp | 7 ------- src/core/application.cpp | 6 +++--- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/include/audio/npc_voice_manager.hpp b/include/audio/npc_voice_manager.hpp index 2a5d7cfb..92ab8f32 100644 --- a/include/audio/npc_voice_manager.hpp +++ b/include/audio/npc_voice_manager.hpp @@ -74,7 +74,6 @@ private: void loadVoiceSounds(); bool loadSound(const std::string& path, VoiceSample& sample); - VoiceType detectVoiceType(uint32_t creatureEntry) const; void playSound(uint64_t npcGuid, VoiceType voiceType, SoundCategory category, const glm::vec3& position); pipeline::AssetManager* assetManager_ = nullptr; diff --git a/src/audio/npc_voice_manager.cpp b/src/audio/npc_voice_manager.cpp index 316fb9b2..1027d165 100644 --- a/src/audio/npc_voice_manager.cpp +++ b/src/audio/npc_voice_manager.cpp @@ -373,12 +373,5 @@ void NpcVoiceManager::playFlee(uint64_t npcGuid, VoiceType voiceType, const glm: playSound(npcGuid, voiceType, SoundCategory::FLEE, position); } -VoiceType NpcVoiceManager::detectVoiceType(uint32_t creatureEntry) const { - // TODO: Use CreatureTemplate.dbc or other data to map creature entry to voice type - // For now, return generic - (void)creatureEntry; - return VoiceType::GENERIC; -} - } // namespace audio } // namespace wowee diff --git a/src/core/application.cpp b/src/core/application.cpp index 5741b877..99658508 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -2109,10 +2109,10 @@ void Application::setupUICallbacks() { int32_t idx = dbc->findRecordById(soundId); if (idx < 0) return; - // SoundEntries.dbc (WotLK): fields 2-11 = Name[0..9], field 22 = DirectoryBase + // SoundEntries.dbc (WotLK): field 2 = Name (label), fields 3-12 = File[0..9], field 23 = DirectoryBase const uint32_t row = static_cast(idx); - std::string dir = dbc->getString(row, 22); - for (uint32_t f = 2; f <= 11; ++f) { + std::string dir = dbc->getString(row, 23); + for (uint32_t f = 3; f <= 12; ++f) { std::string name = dbc->getString(row, f); if (name.empty()) continue; std::string path = dir.empty() ? name : dir + "\\" + name;