From 07954303908a3f98c8a3cea275753c83d5832f38 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sun, 29 Mar 2026 18:11:49 -0700 Subject: [PATCH] cleanup: remove dead pos=0 reassignment and demote chat logs to DEBUG Quest log had a redundant pos=0 right after initialization. Chat handler logged every incoming/outgoing message at WARNING level, flooding the log and obscuring genuine warnings. --- src/game/chat_handler.cpp | 8 ++++---- src/ui/quest_log_screen.cpp | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/game/chat_handler.cpp b/src/game/chat_handler.cpp index 02c0d459..c78d99bd 100644 --- a/src/game/chat_handler.cpp +++ b/src/game/chat_handler.cpp @@ -120,7 +120,7 @@ void ChatHandler::sendChatMessage(ChatType type, const std::string& message, con return; } - LOG_WARNING("OUTGOING CHAT: type=", static_cast(type), " msg='", message.substr(0, 60), "'"); + LOG_DEBUG("OUTGOING CHAT: type=", static_cast(type), " msg='", message.substr(0, 60), "'"); // Use the player's faction language. AzerothCore rejects wrong language. // Alliance races: Human(1), Dwarf(3), NightElf(4), Gnome(7), Draenei(11) → COMMON (7) @@ -165,9 +165,9 @@ void ChatHandler::handleMessageChat(network::Packet& packet) { LOG_WARNING("Failed to parse SMSG_MESSAGECHAT, size=", packet.getSize()); return; } - LOG_WARNING("SMSG_MESSAGECHAT: type=", static_cast(data.type), - " sender='", data.senderName, "' msg='", - data.message.substr(0, 60), "'"); + LOG_DEBUG("SMSG_MESSAGECHAT: type=", static_cast(data.type), + " sender='", data.senderName, "' msg='", + data.message.substr(0, 60), "'"); // Skip server echo of our own messages (we already added a local echo) if (data.senderGuid == owner_.playerGuid && data.senderGuid != 0) { diff --git a/src/ui/quest_log_screen.cpp b/src/ui/quest_log_screen.cpp index d41ac3e8..1ce53ed7 100644 --- a/src/ui/quest_log_screen.cpp +++ b/src/ui/quest_log_screen.cpp @@ -35,7 +35,6 @@ std::string replaceGenderPlaceholders(const std::string& text, game::GameHandler // Replace $g placeholders size_t pos = 0; - pos = 0; while ((pos = result.find('$', pos)) != std::string::npos) { if (pos + 1 >= result.length()) break; char marker = result[pos + 1];