diff options
| author | Shauren <shauren.trinity@gmail.com> | 2018-03-03 15:39:19 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2018-03-25 19:28:36 +0300 |
| commit | 8f53ba385474e51b4e2ebf29e33d7661a2848669 (patch) | |
| tree | 2c3a2ee08d085b096996fdfd349097b151e783f6 /src/server/game/Movement | |
| parent | 3743d042017d72435d2ff8135f66808988beaf9e (diff) | |
Core/Phasing: Rewrite GetTerrainMapId
Diffstat (limited to 'src/server/game/Movement')
| -rw-r--r-- | src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp | 9 | ||||
| -rw-r--r-- | src/server/game/Movement/PathGenerator.cpp | 13 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index 210de91f8b0..c4cd065ccbf 100644 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -23,6 +23,7 @@ #include "ObjectAccessor.h" #include "MoveSplineInit.h" #include "MoveSpline.h" +#include "PhasingHandler.h" #include "Player.h" #include "VMapFactory.h" @@ -51,11 +52,9 @@ void FleeingMovementGenerator<T>::_setTargetLocation(T* owner) // Add LOS check for target point Position mypos = owner->GetPosition(); - bool isInLOS = VMAP::VMapFactory::createOrGetVMapManager()->isInLineOfSight(owner->GetPhaseShift().GetTerrainMapId(owner->GetMapId(), mypos.m_positionX, mypos.m_positionY), - mypos.m_positionX, - mypos.m_positionY, - mypos.m_positionZ + 2.0f, - x, y, z + 2.0f); + bool isInLOS = VMAP::VMapFactory::createOrGetVMapManager()->isInLineOfSight( + PhasingHandler::GetTerrainMapId(owner->GetPhaseShift(), owner->GetMap(), mypos.m_positionX, mypos.m_positionY), + mypos.m_positionX, mypos.m_positionY, mypos.m_positionZ + 2.0f, x, y, z + 2.0f); if (!isInLOS) { i_nextCheckTime.Reset(200); diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 16cfe366f4e..4c89bb99e2c 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -18,15 +18,16 @@ */ #include "PathGenerator.h" -#include "Map.h" #include "Creature.h" -#include "MMapFactory.h" -#include "MMapManager.h" -#include "Log.h" -#include "DisableMgr.h" #include "DetourCommon.h" #include "DetourNavMeshQuery.h" +#include "DisableMgr.h" +#include "Log.h" +#include "MMapFactory.h" +#include "MMapManager.h" +#include "Map.h" #include "Metric.h" +#include "PhasingHandler.h" ////////////////// PathGenerator ////////////////// PathGenerator::PathGenerator(const Unit* owner) : @@ -39,7 +40,7 @@ PathGenerator::PathGenerator(const Unit* owner) : TC_LOG_DEBUG("maps", "++ PathGenerator::PathGenerator for %s", _sourceUnit->GetGUID().ToString().c_str()); - uint32 mapId = _sourceUnit->GetPhaseShift().GetTerrainMapId(_sourceUnit->GetMapId(), _sourceUnit->GetPositionX(), _sourceUnit->GetPositionY()); + uint32 mapId = PhasingHandler::GetTerrainMapId(_sourceUnit->GetPhaseShift(), _sourceUnit->GetMap(), _sourceUnit->GetPositionX(), _sourceUnit->GetPositionY()); if (DisableMgr::IsPathfindingEnabled(_sourceUnit->GetMapId())) { MMAP::MMapManager* mmap = MMAP::MMapFactory::createOrGetMMapManager(); |
