diff --git a/src/server/game/Movement/MovementGenerators/PathGenerator.cpp b/src/server/game/Movement/MovementGenerators/PathGenerator.cpp index 620282f98..a727aafb7 100644 --- a/src/server/game/Movement/MovementGenerators/PathGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PathGenerator.cpp @@ -576,46 +576,13 @@ void PathGenerator::BuildPointPath(const float* startPoint, const float* endPoin } _pathPoints.resize(pointCount); - uint32 newPointCount = 0; - for (uint32 i = 0; i < pointCount; ++i) { - G3D::Vector3 vector = G3D::Vector3(pathPoints[i * VERTEX_SIZE + 2], pathPoints[i * VERTEX_SIZE], pathPoints[i * VERTEX_SIZE + 1]); - LiquidData const& liquidData = _source->GetMap()->GetLiquidData(_source->GetPhaseMask(), vector.x, vector.y, vector.z, _source->GetCollisionHeight(), MAP_ALL_LIQUIDS); - // One of the points is not in the water - if (liquidData.Status == LIQUID_MAP_UNDER_WATER) - { - // if the first point is under water - // then set a proper z for it - if (i == 0) - { - vector.z = std::fmaxf(vector.z, _source->GetPositionZ()); - _pathPoints[newPointCount] = vector; - } - // if the last point is under water - // then set the desired end position instead - else if (i == pointCount - 1) - { - _pathPoints[newPointCount] = GetActualEndPosition(); - } - // if one of the mid-points of the path is underwater - // then we can create a shortcut between the previous one - // and the next one by not including it inside the list - else - continue; - } - else - { - _pathPoints[newPointCount] = vector; - } - - newPointCount++; - } - - _pathPoints.resize(newPointCount); + for (uint32 i = 0; i < pointCount; ++i) + _pathPoints[i] = G3D::Vector3(pathPoints[i * VERTEX_SIZE + 2], pathPoints[i * VERTEX_SIZE], pathPoints[i * VERTEX_SIZE + 1]); NormalizePath(); // first point is always our current location - we need the next one - SetActualEndPosition(_pathPoints[newPointCount - 1]); + SetActualEndPosition(_pathPoints[pointCount - 1]); // force the given destination, if needed if (_forceDestination &&