Cherry pick health % not being applied bug from commit f0ea435562 into master branch. Release Build 9424.
This commit is contained in:
@@ -250,8 +250,9 @@ const int Player::GetHealth()const{
|
||||
return hp;
|
||||
}
|
||||
|
||||
const float&Player::GetMaxHealth()const{
|
||||
return GetStat("Health");
|
||||
const float Player::GetMaxHealth()const{
|
||||
const float hpPctIncrease=GetStat("Health")*GetStat("Health %")/100.f;
|
||||
return GetStat("Health")+hpPctIncrease;
|
||||
}
|
||||
|
||||
const int Player::GetMana()const{
|
||||
@@ -1527,7 +1528,7 @@ const bool Player::UsingAutoAim()const{
|
||||
void Player::UpdateHealthAndMana(){
|
||||
//Perform a check to make sure stats are initialized before they can be used.
|
||||
if(game->GameInitialized()){
|
||||
hp=std::min(hp,int(GetStat("Health")));
|
||||
hp=std::min(hp,int(GetMaxHealth()));
|
||||
mana=std::min(mana,GetMaxMana());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user