mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
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:
parent
84a6ee4801
commit
1446d4fddd
1 changed files with 7 additions and 1 deletions
|
|
@ -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<Unit>(pe))
|
||||
playerPowerType = static_cast<int>(pu->getPowerType());
|
||||
}
|
||||
const char* reason = getSpellCastResultString(castResult, playerPowerType);
|
||||
MessageChatData msg;
|
||||
msg.type = ChatType::SYSTEM;
|
||||
msg.language = ChatLanguage::UNIVERSAL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue