[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.
This commit is contained in:
VladimirMangos 2009-12-03 00:19:12 +03:00
parent 2c17ba41f1
commit c2f77ae278
2 changed files with 6 additions and 3 deletions

View file

@ -224,9 +224,12 @@ void Player::UpdateMaxPower(Powers power)
{ {
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + 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, BASE_PCT);
value += GetModifierValue(unitMod, TOTAL_VALUE) + bonusPower; value += GetModifierValue(unitMod, TOTAL_VALUE) + bonusPower;
value *= GetModifierValue(unitMod, TOTAL_PCT); value *= GetModifierValue(unitMod, TOTAL_PCT);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8906" #define REVISION_NR "8907"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__