mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 19:31:59 +01:00
Adjust maximum sizes of some healthcalculations over to utilize 64-bit uint
--HG-- branch : trunk
This commit is contained in:
@@ -154,7 +154,7 @@ struct ScriptedAI : public CreatureAI
|
||||
//Selects a unit from the creature's current aggro list
|
||||
Unit* SelectUnit(SelectAggroTarget pTarget, uint32 uiPosition);
|
||||
|
||||
bool HealthBelowPct(uint32 pct) const { return me->GetHealth() * 100 < me->GetMaxHealth() * pct; }
|
||||
bool HealthBelowPct(uint64 pct) const { return me->GetHealth() * 100 < me->GetMaxHealth() * pct; }
|
||||
|
||||
//Returns spells that meet the specified criteria from the creatures spell list
|
||||
SpellEntry const* SelectSpell(Unit* Target, uint32 School, uint32 Mechanic, SelectTargetType Targets, uint32 PowerCostMin, uint32 PowerCostMax, float RangeMin, float RangeMax, SelectEffect Effect);
|
||||
|
||||
@@ -4626,7 +4626,7 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const * aurApp, uint8
|
||||
if ((GetMiscValue() == STAT_STAMINA) && (maxHPValue > 0) && (m_spellProto->Attributes & 0x10))
|
||||
{
|
||||
// newHP = (curHP / maxHP) * newMaxHP = (newMaxHP * curHP) / maxHP -> which is better because no int -> double -> int conversion is needed
|
||||
uint32 newHPValue = (target->GetMaxHealth() * curHPValue) / maxHPValue;
|
||||
uint64 newHPValue = (target->GetMaxHealth() * curHPValue) / maxHPValue;
|
||||
target->SetHealth(newHPValue);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user