Fix bug with Health % item stats/set effects not being applied to the player. Release Build 9424.
This commit is contained in:
parent
c7b5660a70
commit
17ab92eeee
@ -250,8 +250,9 @@ const int Player::GetHealth()const{
|
|||||||
return hp;
|
return hp;
|
||||||
}
|
}
|
||||||
|
|
||||||
const float&Player::GetMaxHealth()const{
|
const float Player::GetMaxHealth()const{
|
||||||
return GetStat("Health");
|
const float hpPctIncrease=GetStat("Health")*GetStat("Health %")/100.f;
|
||||||
|
return GetStat("Health")+hpPctIncrease;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int Player::GetMana()const{
|
const int Player::GetMana()const{
|
||||||
@ -1527,7 +1528,7 @@ const bool Player::UsingAutoAim()const{
|
|||||||
void Player::UpdateHealthAndMana(){
|
void Player::UpdateHealthAndMana(){
|
||||||
//Perform a check to make sure stats are initialized before they can be used.
|
//Perform a check to make sure stats are initialized before they can be used.
|
||||||
if(game->GameInitialized()){
|
if(game->GameInitialized()){
|
||||||
hp=std::min(hp,int(GetStat("Health")));
|
hp=std::min(hp,int(GetMaxHealth()));
|
||||||
mana=std::min(mana,GetMaxMana());
|
mana=std::min(mana,GetMaxMana());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ public:
|
|||||||
const float&GetBaseStat(std::string_view a)const;
|
const float&GetBaseStat(std::string_view a)const;
|
||||||
void SetBaseStat(std::string_view a,float val);
|
void SetBaseStat(std::string_view a,float val);
|
||||||
void SetBaseStat(ItemAttribute a,float val);
|
void SetBaseStat(ItemAttribute a,float val);
|
||||||
const float&GetMaxHealth()const;
|
const float GetMaxHealth()const;
|
||||||
const int GetHealth()const;
|
const int GetHealth()const;
|
||||||
const int GetMana()const;
|
const int GetMana()const;
|
||||||
const int GetMaxMana()const;
|
const int GetMaxMana()const;
|
||||||
|
@ -38,8 +38,8 @@ All rights reserved.
|
|||||||
#pragma once
|
#pragma once
|
||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 3
|
||||||
#define VERSION_BUILD 9416
|
#define VERSION_BUILD 9424
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user