From cc0f7cee6805eb62e814be89c2fc80c958c6a3c6 Mon Sep 17 00:00:00 2001 From: Matteo Emili Date: Sat, 21 Jan 2017 23:10:17 +0100 Subject: [PATCH] Fix for OnAfterUpdateMaxPower hook --- src/game/Entities/Unit/StatSystem.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/game/Entities/Unit/StatSystem.cpp b/src/game/Entities/Unit/StatSystem.cpp index 9110e2a0a..fac97df16 100644 --- a/src/game/Entities/Unit/StatSystem.cpp +++ b/src/game/Entities/Unit/StatSystem.cpp @@ -292,13 +292,12 @@ void Player::UpdateMaxPower(Powers power) float bonusPower = (power == POWER_MANA && GetCreatePowers(power) > 0) ? GetManaBonusFromIntellect() : 0; - sScriptMgr->OnAfterUpdateMaxPower(this, power, bonusPower); - float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power); value *= GetModifierValue(unitMod, BASE_PCT); value += GetModifierValue(unitMod, TOTAL_VALUE) + bonusPower; value *= GetModifierValue(unitMod, TOTAL_PCT); + sScriptMgr->OnAfterUpdateMaxPower(this, power, value); SetMaxPower(power, uint32(value)); }