fix: pass player power type to getSpellCastResultString for result 85

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'.
This commit is contained in:
Kelsi 2026-03-11 03:41:49 -07:00
parent 84a6ee4801
commit 1446d4fddd

View file

@ -1906,7 +1906,13 @@ void GameHandler::handlePacket(network::Packet& packet) {
casting = false; casting = false;
currentCastSpellId = 0; currentCastSpellId = 0;
castTimeRemaining = 0.0f; 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<Unit>(pe))
playerPowerType = static_cast<int>(pu->getPowerType());
}
const char* reason = getSpellCastResultString(castResult, playerPowerType);
MessageChatData msg; MessageChatData msg;
msg.type = ChatType::SYSTEM; msg.type = ChatType::SYSTEM;
msg.language = ChatLanguage::UNIVERSAL; msg.language = ChatLanguage::UNIVERSAL;