diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 944ace913..2f59add36 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -223,6 +223,8 @@ void Player::UpdateMaxHealth() void Player::UpdateMaxPower(Powers power) { + MANGOS_ASSERT(power < MAX_POWERS); + UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power); uint32 create_power = GetCreatePowers(power); @@ -856,6 +858,8 @@ void Creature::UpdateMaxHealth() void Creature::UpdateMaxPower(Powers power) { + MANGOS_ASSERT(power < MAX_POWERS); + UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power); float value = GetTotalAuraModValue(unitMod); @@ -1027,6 +1031,8 @@ void Pet::UpdateMaxHealth() void Pet::UpdateMaxPower(Powers power) { + MANGOS_ASSERT(power < MAX_POWERS); + UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power); float addValue = (power == POWER_MANA) ? GetStat(STAT_INTELLECT) - GetCreateStat(STAT_INTELLECT) : 0.0f; diff --git a/src/game/Unit.h b/src/game/Unit.h index 927820952..ba3fa6e42 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -332,8 +332,13 @@ enum UnitMods UNIT_MOD_RAGE, UNIT_MOD_FOCUS, UNIT_MOD_ENERGY, + UNIT_MOD_HAPPINESS, // REQUIRED for fast indexing to work. UNIT_MOD_RUNE, UNIT_MOD_RUNIC_POWER, + UNIT_MOD_SOUL_SHARDS, + UNIT_MOD_ECLIPSE, + UNIT_MOD_HOLY_POWER, + UNIT_MOD_ALTERNATE, UNIT_MOD_ARMOR, // UNIT_MOD_ARMOR..UNIT_MOD_RESISTANCE_ARCANE must be in existing order, it's accessed by index values of SpellSchools enum. UNIT_MOD_RESISTANCE_HOLY, UNIT_MOD_RESISTANCE_FIRE,