mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
Fix UnitMods. This fixes buffer overflows.
/me pokes @Fabi
This commit is contained in:
parent
adabb1556d
commit
a5ca883668
2 changed files with 11 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue