refactor(Core): code cleanup (part 2) (#6374)

This commit is contained in:
Francesco Borzì 2021-06-16 20:40:42 +02:00 committed by GitHub
parent 8f7ad83010
commit 466cdb68d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
80 changed files with 198 additions and 209 deletions

View file

@ -6,7 +6,6 @@
#include "Creature.h"
#include "DetourCommon.h"
#include "DisableMgr.h"
#include "Geometry.h"
#include "Log.h"
#include "Map.h"
@ -1155,13 +1154,13 @@ bool PathGenerator::IsSwimmableSegment(float x, float y, float z, float destX, f
(!checkSwim || !_sourceCreature || _sourceCreature->CanSwim());
}
bool PathGenerator::IsWaterPath(Movement::PointsArray _pathPoints) const
bool PathGenerator::IsWaterPath(Movement::PointsArray pathPoints) const
{
bool waterPath = true;
// Check both start and end points, if they're both in water, then we can *safely* let the creature move
for (uint32 i = 0; i < _pathPoints.size(); ++i)
for (uint32 i = 0; i < pathPoints.size(); ++i)
{
NavTerrain terrain = GetNavTerrain(_pathPoints[i].x, _pathPoints[i].y, _pathPoints[i].z);
NavTerrain terrain = GetNavTerrain(pathPoints[i].x, pathPoints[i].y, pathPoints[i].z);
// One of the points is not in the water
if (terrain != NAV_MAGMA && terrain != NAV_WATER)
{