From 615db7981987868fa92bf4bf973b0f3b7f0a0bea Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 28 Mar 2026 15:09:52 -0700 Subject: [PATCH] fix: skip all-zero equipment emit, broaden BG announcer filter Equipment: the first emitOtherPlayerEquipment call fired before any item queries returned, sending all-zero displayIds that stripped players naked. Now skips the callback when resolved=0 (waiting for queries). Equipment only applies once at least one item resolves, preventing the naked flash. BG announcer: broadened filter to match ALL chat types (not just SYSTEM), and added more patterns: "BGAnnouncer", "[H: N, A: N]" with spaces. Also added diagnostic logging in setOnlinePlayerEquipment to trace displayId counts reaching the renderer. --- src/core/application.cpp | 13 ++++++++++++- src/game/chat_handler.cpp | 9 +++++---- src/game/inventory_handler.cpp | 7 +++++++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/core/application.cpp b/src/core/application.cpp index 4755151c..fc68045c 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -7574,7 +7574,18 @@ void Application::setOnlinePlayerEquipment(uint64_t guid, if (!charRenderer) return; if (st.instanceId == 0 || st.modelId == 0) return; - if (st.bodySkinPath.empty()) return; + if (st.bodySkinPath.empty()) { + LOG_WARNING("setOnlinePlayerEquipment: bodySkinPath empty for guid=0x", std::hex, guid, std::dec, + " instanceId=", st.instanceId, " — skipping equipment"); + return; + } + + int nonZeroDisplay = 0; + for (uint32_t d : displayInfoIds) if (d != 0) nonZeroDisplay++; + LOG_WARNING("setOnlinePlayerEquipment: guid=0x", std::hex, guid, std::dec, + " instanceId=", st.instanceId, " nonZeroDisplayIds=", nonZeroDisplay, + " head=", displayInfoIds[0], " chest=", displayInfoIds[4], + " legs=", displayInfoIds[6], " mainhand=", displayInfoIds[15]); auto displayInfoDbc = assetManager->loadDBC("ItemDisplayInfo.dbc"); if (!displayInfoDbc) return; diff --git a/src/game/chat_handler.cpp b/src/game/chat_handler.cpp index e33090ba..952ecc22 100644 --- a/src/game/chat_handler.cpp +++ b/src/game/chat_handler.cpp @@ -197,14 +197,15 @@ void ChatHandler::handleMessageChat(network::Packet& packet) { } // Filter BG queue announcer spam (server-side module on ChromieCraft/AzerothCore). - // These are SYSTEM messages with BG queue status that flood the chat. - if (data.type == ChatType::SYSTEM) { + // Can arrive as SYSTEM, CHANNEL, or even SAY/YELL from special NPCs. + { const auto& msg = data.message; - // Common patterns: "[BG Queue Announcer]", "Queue status for", "[H: N/N, A: N/N]" if (msg.find("Queue status") != std::string::npos || msg.find("BG Queue") != std::string::npos || msg.find("Announcer]") != std::string::npos || - (msg.find("[H:") != std::string::npos && msg.find("A:") != std::string::npos)) { + msg.find("BGAnnouncer") != std::string::npos || + (msg.find("[H:") != std::string::npos && msg.find("A:") != std::string::npos) || + (msg.find("[H: ") != std::string::npos && msg.find(", A: ") != std::string::npos)) { return; // Suppress BG queue announcer spam } } diff --git a/src/game/inventory_handler.cpp b/src/game/inventory_handler.cpp index 336d9069..998d720c 100644 --- a/src/game/inventory_handler.cpp +++ b/src/game/inventory_handler.cpp @@ -3200,6 +3200,13 @@ void InventoryHandler::emitOtherPlayerEquipment(uint64_t guid) { " chest=", displayIds[4], " legs=", displayIds[6], " mainhand=", displayIds[15], " offhand=", displayIds[16]); + // Don't emit all-zero displayIds — that strips existing equipment for no reason. + // Wait until at least one item resolves before applying. + if (anyEntry && resolved == 0) { + LOG_WARNING("emitOtherPlayerEquipment: skipping all-zero emit (waiting for item queries)"); + return; + } + owner_.playerEquipmentCallback_(guid, displayIds, invTypes); owner_.otherPlayerVisibleDirty_.erase(guid);