From c2f77ae2782fd4c7c366ca877533b637557c6a53 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Thu, 3 Dec 2009 00:19:12 +0300 Subject: [PATCH] [8907] Avoid set intelect bonus to mana amunt if character not have mana. This fix bug when not non-caster classes show mana subbar in way as it must be show only for druid in form. --- src/game/StatSystem.cpp | 7 +++++-- src/shared/revision_nr.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index af573e88a..8275d0c2f 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -224,9 +224,12 @@ void Player::UpdateMaxPower(Powers power) { UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power); - float bonusPower = (power == POWER_MANA) ? GetManaBonusFromIntellect() : 0; + uint32 create_power = GetCreatePowers(power); - float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power); + // ignore classes without mana + float bonusPower = (power == POWER_MANA && create_power > 0) ? GetManaBonusFromIntellect() : 0; + + float value = GetModifierValue(unitMod, BASE_VALUE) + create_power; value *= GetModifierValue(unitMod, BASE_PCT); value += GetModifierValue(unitMod, TOTAL_VALUE) + bonusPower; value *= GetModifierValue(unitMod, TOTAL_PCT); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 37e174755..a9611d2f3 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8906" + #define REVISION_NR "8907" #endif // __REVISION_NR_H__