mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
Proper power uses.
This commit is contained in:
parent
ef2aa96340
commit
adabb1556d
3 changed files with 23 additions and 16 deletions
|
|
@ -9815,7 +9815,7 @@ int32 Unit::GetPower(Powers power) const
|
|||
if (power == POWER_HEALTH)
|
||||
return GetHealth();
|
||||
|
||||
uint32 powerIndex = GetPowerIndexByClass(power, getClass());
|
||||
uint32 powerIndex = GetPowerIndex(power);
|
||||
if (powerIndex == INVALID_POWER_INDEX)
|
||||
return 0;
|
||||
|
||||
|
|
@ -9834,7 +9834,7 @@ uint32 Unit::GetMaxPower(Powers power) const
|
|||
if (power == POWER_HEALTH)
|
||||
return GetMaxHealth();
|
||||
|
||||
uint32 powerIndex = GetPowerIndexByClass(power, getClass());
|
||||
uint32 powerIndex = GetPowerIndex(power);
|
||||
if (powerIndex == INVALID_POWER_INDEX)
|
||||
return 0;
|
||||
|
||||
|
|
@ -9853,7 +9853,7 @@ void Unit::SetPower(Powers power, int32 val)
|
|||
if (power == POWER_HEALTH)
|
||||
return SetHealth(val >= 0 ? val : 0);
|
||||
|
||||
uint32 powerIndex = GetPowerIndexByClass(power, getClass());
|
||||
uint32 powerIndex = GetPowerIndex(power);
|
||||
if (powerIndex == INVALID_POWER_INDEX)
|
||||
return;
|
||||
|
||||
|
|
@ -9903,7 +9903,7 @@ void Unit::SetMaxPower(Powers power, int32 val)
|
|||
if (power == POWER_HEALTH)
|
||||
return SetMaxHealth(val >= 0 ? val : 0);
|
||||
|
||||
uint32 powerIndex = GetPowerIndexByClass(power, getClass());
|
||||
uint32 powerIndex = GetPowerIndex(power);
|
||||
if (powerIndex == INVALID_POWER_INDEX)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue