mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-19 22:49:39 -04:00
Core/StatSystem: Fixed possible crash when calculating health bonus from stamina
Closes #8595 Closes #8620
This commit is contained in:
@@ -215,13 +215,15 @@ void Player::UpdateArmor()
|
||||
float Player::GetHealthBonusFromStamina()
|
||||
{
|
||||
// Taken from PaperDollFrame.lua - 4.3.4.15595
|
||||
gtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry((getClass() - 1) * GT_MAX_LEVEL + getLevel() - 1);
|
||||
float ratio = 10.0f;
|
||||
if (gtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry((getClass() - 1) * GT_MAX_LEVEL + getLevel() - 1))
|
||||
ratio = hpBase->ratio;
|
||||
|
||||
float stamina = GetStat(STAT_STAMINA);
|
||||
float baseStam = std::min(20.0f, stamina);
|
||||
float moreStam = stamina - baseStam;
|
||||
|
||||
return baseStam + moreStam * hpBase->ratio;
|
||||
return baseStam + moreStam * ratio;
|
||||
}
|
||||
|
||||
float Player::GetManaBonusFromIntellect()
|
||||
|
||||
Reference in New Issue
Block a user