refactor(Core/Misc): fabs() to std::fabs() (#9790)

- prefer std functions over C functions
This commit is contained in:
Kitzunu
2022-01-01 00:41:00 +01:00
committed by GitHub
parent ac99eb48e1
commit 913e65f97f
26 changed files with 43 additions and 43 deletions

View File

@@ -160,7 +160,7 @@ void SmartAI::GenerateWayPointArray(Movement::PointsArray* points)
for (uint32 i = 1; i < pVector.size() - 1; ++i)
{
offset = middle - pVector[i];
if (fabs(offset.x) >= 0xFF || fabs(offset.y) >= 0xFF || fabs(offset.z) >= 0x7F)
if (std::fabs(offset.x) >= 0xFF || std::fabs(offset.y) >= 0xFF || std::fabs(offset.z) >= 0x7F)
{
// offset is too big, split points
continueLoop = true;

View File

@@ -272,7 +272,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
// xinef: rozpierdol tc, niedojeby ze szok
if (temp.action.type == SMART_ACTION_MOVE_TO_POS)
if (temp.target.type == SMART_TARGET_SELF && (fabs(temp.target.x) > 200.0f || fabs(temp.target.y) > 200.0f || fabs(temp.target.z) > 200.0f))
if (temp.target.type == SMART_TARGET_SELF && (std::fabs(temp.target.x) > 200.0f || std::fabs(temp.target.y) > 200.0f || std::fabs(temp.target.z) > 200.0f))
temp.target.type = SMART_TARGET_POSITION;
// creature entry / guid not found in storage, create empty event list for it and increase counters