From 2a52aedbf77afb01ac3efe7779031c07077c6352 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 06:24:16 -0700 Subject: [PATCH] fix: show quest name instead of ID in failed/timed-out quest messages SMSG_QUESTUPDATE_FAILED and SMSG_QUESTUPDATE_FAILEDTIMER were emitting generic "Quest 12345 failed!" messages. Now looks up the title from questLog_ and shows e.g. "\"Report to Gryan Stoutmantle\" failed!" for a much more readable notification. Falls back to the generic form if the title is not cached. --- src/game/game_handler.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 10f9f144..18713eb0 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -1845,9 +1845,12 @@ void GameHandler::handlePacket(network::Packet& packet) { // uint32 questId if (packet.getSize() - packet.getReadPos() >= 4) { uint32_t questId = packet.readUInt32(); - char buf[128]; - std::snprintf(buf, sizeof(buf), "Quest %u failed!", questId); - addSystemChatMessage(buf); + std::string questTitle; + for (const auto& q : questLog_) + if (q.questId == questId && !q.title.empty()) { questTitle = q.title; break; } + addSystemChatMessage(questTitle.empty() + ? std::string("Quest failed!") + : ('"' + questTitle + "\" failed!")); } break; } @@ -1855,9 +1858,12 @@ void GameHandler::handlePacket(network::Packet& packet) { // uint32 questId if (packet.getSize() - packet.getReadPos() >= 4) { uint32_t questId = packet.readUInt32(); - char buf[128]; - std::snprintf(buf, sizeof(buf), "Quest %u timed out!", questId); - addSystemChatMessage(buf); + std::string questTitle; + for (const auto& q : questLog_) + if (q.questId == questId && !q.title.empty()) { questTitle = q.title; break; } + addSystemChatMessage(questTitle.empty() + ? std::string("Quest timed out!") + : ('"' + questTitle + "\" has timed out.")); } break; }