From 1446d4fddd3d9e4735403db07e2649f814fa8eb6 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 03:41:49 -0700 Subject: [PATCH] fix: pass player power type to getSpellCastResultString for result 85 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Result 85 is 'not enough power' — the message should say 'Not enough rage', 'Not enough energy', 'Not enough runic power', etc. based on the player's actual power type rather than always showing 'Not enough mana'. --- src/game/game_handler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 9bb2fa6a..f7910c56 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -1906,7 +1906,13 @@ void GameHandler::handlePacket(network::Packet& packet) { casting = false; currentCastSpellId = 0; castTimeRemaining = 0.0f; - const char* reason = getSpellCastResultString(castResult, -1); + // Pass player's power type so result 85 says "Not enough rage/energy/etc." + int playerPowerType = -1; + if (auto pe = entityManager.getEntity(playerGuid)) { + if (auto pu = std::dynamic_pointer_cast(pe)) + playerPowerType = static_cast(pu->getPowerType()); + } + const char* reason = getSpellCastResultString(castResult, playerPowerType); MessageChatData msg; msg.type = ChatType::SYSTEM; msg.language = ChatLanguage::UNIVERSAL;