mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-28 09:33:52 +00:00
Fix power bar visibility: include Runic Power (type 6) in fixed-max fallback
Death Knights with runic power (type 6) had no power bar visible until the server explicitly sent UNIT_FIELD_MAXPOWER1, because the type-6 max was not included in the 'assume 100' fallback. Runic Power has a fixed cap of 100, same as Rage (1), Focus (2), and Energy (3).
This commit is contained in:
parent
caea24f6ea
commit
819a38a7ca
1 changed files with 3 additions and 3 deletions
|
|
@ -1792,9 +1792,9 @@ void GameScreen::renderPlayerFrame(game::GameHandler& gameHandler) {
|
|||
uint8_t powerType = unit->getPowerType();
|
||||
uint32_t power = unit->getPower();
|
||||
uint32_t maxPower = unit->getMaxPower();
|
||||
// Rage (1) and Energy (3) always cap at 100 — show bar even if server
|
||||
// hasn't sent UNIT_FIELD_MAXPOWER1 yet (warriors start combat at 0 rage).
|
||||
if (maxPower == 0 && (powerType == 1 || powerType == 3)) maxPower = 100;
|
||||
// Rage (1), Focus (2), Energy (3), and Runic Power (6) always cap at 100.
|
||||
// Show bar even if server hasn't sent UNIT_FIELD_MAXPOWER1 yet.
|
||||
if (maxPower == 0 && (powerType == 1 || powerType == 2 || powerType == 3 || powerType == 6)) maxPower = 100;
|
||||
if (maxPower > 0) {
|
||||
float mpPct = static_cast<float>(power) / static_cast<float>(maxPower);
|
||||
ImVec4 powerColor;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue