From 220f1b177cbcc25611ffa2e6e0ba6bd99149c7b3 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 17 Mar 2026 17:36:25 -0700 Subject: [PATCH] fix: surface trainer/resurrect/innkeeper/difficulty errors in UIError overlay - SMSG_TRAINER_BUY_FAILED: "Cannot learn [spell]" now appears as red overlay - SMSG_RESURRECT_FAILED: all resurrection failure reasons shown as UIError - SMSG_BINDZONEREPLY error: "Too far from innkeeper" shown as UIError - SMSG_CHANGEPLAYER_DIFFICULTY_RESULT error: reason shown as UIError - SMSG_INVENTORY_CHANGE_FAILURE case 1: level-gated equip error now calls addUIError before the early break, matching all other inventory error paths --- src/game/game_handler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 3f4db8c9..c56619a2 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -2541,6 +2541,7 @@ void GameHandler::handlePacket(network::Packet& packet) { if (result == 0) { addSystemChatMessage("Your home is now set to this location."); } else { + addUIError("You are too far from the innkeeper."); addSystemChatMessage("You are too far from the innkeeper."); } } @@ -2559,6 +2560,7 @@ void GameHandler::handlePacket(network::Packet& packet) { "You must be in a raid group", "Player not in group" }; const char* msg = (result < 8) ? reasons[result] : "Difficulty change failed."; + addUIError(std::string("Cannot change difficulty: ") + msg); addSystemChatMessage(std::string("Cannot change difficulty: ") + msg); } } @@ -3959,6 +3961,7 @@ void GameHandler::handlePacket(network::Packet& packet) { else if (errorCode == 2) msg += " (already known)"; else if (errorCode != 0) msg += " (error " + std::to_string(errorCode) + ")"; + addUIError(msg); addSystemChatMessage(msg); // Play error sound so the player notices the failure if (auto* renderer = core::Application::getInstance().getRenderer()) { @@ -4616,8 +4619,10 @@ void GameHandler::handlePacket(network::Packet& packet) { if (requiredLevel > 0) { std::snprintf(levelBuf, sizeof(levelBuf), "You must reach level %u to use that item.", requiredLevel); + addUIError(levelBuf); addSystemChatMessage(levelBuf); } else { + addUIError("You must reach a higher level to use that item."); addSystemChatMessage("You must reach a higher level to use that item."); } break; @@ -4955,6 +4960,7 @@ void GameHandler::handlePacket(network::Packet& packet) { const char* msg = (reason == 1) ? "The target cannot be resurrected right now." : (reason == 2) ? "Cannot resurrect in this area." : "Resurrection failed."; + addUIError(msg); addSystemChatMessage(msg); LOG_DEBUG("SMSG_RESURRECT_FAILED: reason=", reason); }