mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 13:46:24 +00:00
refactor(Core): code cleanup (part 2) (#6374)
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
#include "CreatureAI.h"
|
||||
#include "FleeingMovementGenerator.h"
|
||||
#include "MapManager.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ class PathGenerator
|
||||
[[nodiscard]] bool IsWalkableClimb(float const* v1, float const* v2) const;
|
||||
[[nodiscard]] bool IsWalkableClimb(float x, float y, float z, float destX, float destY, float destZ) const;
|
||||
[[nodiscard]] static bool IsWalkableClimb(float x, float y, float z, float destX, float destY, float destZ, float sourceHeight);
|
||||
[[nodiscard]] bool IsWaterPath(Movement::PointsArray _pathPoints) const;
|
||||
[[nodiscard]] bool IsWaterPath(Movement::PointsArray pathPoints) const;
|
||||
[[nodiscard]] bool IsSwimmableSegment(float const* v1, float const* v2, bool checkSwim = true) const;
|
||||
[[nodiscard]] bool IsSwimmableSegment(float x, float y, float z, float destX, float destY, float destZ, bool checkSwim = true) const;
|
||||
[[nodiscard]] static float GetRequiredHeightToClimb(float x, float y, float z, float destX, float destY, float destZ, float sourceHeight);
|
||||
|
||||
@@ -50,9 +50,9 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
||||
{
|
||||
owner->StopMoving();
|
||||
_lastTargetPosition.reset();
|
||||
if (Creature* cOwner = owner->ToCreature())
|
||||
if (Creature* cOwner2 = owner->ToCreature())
|
||||
{
|
||||
cOwner->SetCannotReachTarget(false);
|
||||
cOwner2->SetCannotReachTarget(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -82,9 +82,9 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
||||
{
|
||||
i_recalculateTravel = false;
|
||||
i_path = nullptr;
|
||||
if (Creature* cOwner = owner->ToCreature())
|
||||
if (Creature* cOwner2 = owner->ToCreature())
|
||||
{
|
||||
cOwner->SetCannotReachTarget(false);
|
||||
cOwner2->SetCannotReachTarget(false);
|
||||
}
|
||||
|
||||
owner->StopMoving();
|
||||
|
||||
Reference in New Issue
Block a user