From dcf9aeed92fefe5132acacfaf9832476588feb8f Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 17 Mar 2026 17:20:24 -0700 Subject: [PATCH] fix: show SMSG_CAST_FAILED reason in UIError overlay handleCastFailed was only posting to chat; now also calls addUIError so mid-cast server rejections (e.g. "Interrupted") show the same red on-screen overlay as SMSG_CAST_RESULT failures already did. --- src/game/game_handler.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 2c8b704c..32eb8bb3 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -18157,21 +18157,20 @@ void GameHandler::handleCastFailed(network::Packet& packet) { } } - // Add system message about failed cast with readable reason + // Show failure reason in the UIError overlay and in chat int powerType = -1; auto playerEntity = entityManager.getEntity(playerGuid); if (auto playerUnit = std::dynamic_pointer_cast(playerEntity)) { powerType = playerUnit->getPowerType(); } const char* reason = getSpellCastResultString(data.result, powerType); + std::string errMsg = reason ? reason + : ("Spell cast failed (error " + std::to_string(data.result) + ")"); + addUIError(errMsg); MessageChatData msg; msg.type = ChatType::SYSTEM; msg.language = ChatLanguage::UNIVERSAL; - if (reason) { - msg.message = reason; - } else { - msg.message = "Spell cast failed (error " + std::to_string(data.result) + ")"; - } + msg.message = errMsg; addLocalChatMessage(msg); }