mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[9427] Add helper functions for Unit::Get/SetHealthPercent
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
6b0189fed3
commit
67c5e57b0a
3 changed files with 9 additions and 1 deletions
|
|
@ -11649,6 +11649,12 @@ void Unit::SetMaxHealth(uint32 val)
|
|||
SetHealth(val);
|
||||
}
|
||||
|
||||
void Unit::SetHealthPercent(float percent)
|
||||
{
|
||||
uint32 newHealth = GetMaxHealth() * percent/100.0f;
|
||||
SetHealth(newHealth);
|
||||
}
|
||||
|
||||
void Unit::SetPower(Powers power, uint32 val)
|
||||
{
|
||||
if(GetPower(power) == val)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue