mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 08:33:47 +00:00
refactor(Core/Misc): sqrt/log/exp() to std::sqrt/log/exp() (#9792)
This commit is contained in:
@@ -2088,7 +2088,7 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const
|
||||
float dx = x - GetPositionX();
|
||||
float dy = y - GetPositionY();
|
||||
float dz = z - GetPositionZ();
|
||||
float dist = sqrt(dx * dx + dy * dy);
|
||||
float dist = std::sqrt(dx * dx + dy * dy);
|
||||
//! Check if the distance between the 2 objects is 0, can happen if both objects are on the same position.
|
||||
//! The code below this check wont crash if dist is 0 because 0/0 in float operations is valid, and returns infinite
|
||||
if (G3D::fuzzyEq(dist, 0.0f))
|
||||
|
||||
@@ -1481,7 +1481,7 @@ bool WorldObject::IsInBetween(const WorldObject* obj1, const WorldObject* obj2,
|
||||
float A = (obj2->GetPositionY() - obj1->GetPositionY()) / (obj2->GetPositionX() - obj1->GetPositionX());
|
||||
float B = -1;
|
||||
float C = obj1->GetPositionY() - A * obj1->GetPositionX();
|
||||
float dist = std::fabs(A * GetPositionX() + B * GetPositionY() + C) / sqrt(A * A + B * B);
|
||||
float dist = std::fabs(A * GetPositionX() + B * GetPositionY() + C) / std::sqrt(A * A + B * B);
|
||||
return dist <= size;
|
||||
}
|
||||
|
||||
|
||||
@@ -918,7 +918,7 @@ void Player::UpdateManaRegen()
|
||||
|
||||
float Intellect = GetStat(STAT_INTELLECT);
|
||||
// Mana regen from spirit and intellect
|
||||
float power_regen = sqrt(Intellect) * OCTRegenMPPerSpirit();
|
||||
float power_regen = std::sqrt(Intellect) * OCTRegenMPPerSpirit();
|
||||
// Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen
|
||||
power_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user