diff options
| author | Rat <gmstreetrat@gmail.com> | 2015-03-24 20:01:02 +0100 |
|---|---|---|
| committer | Rat <gmstreetrat@gmail.com> | 2015-03-24 20:01:02 +0100 |
| commit | eebc468e628acc801a6426e03815150c8cfd9172 (patch) | |
| tree | 2f269f7b97bd7fe83b8bfeb3240820521110f9aa /src/server/game/Movement | |
| parent | bc5ebe3d0599a08e93fd6d0a8c63c7e7cc43c35f (diff) | |
| parent | 3ad7776d5061308d3e2b4ff9e3cbf67d48bffdd6 (diff) | |
Merge branch '6.x' of https://github.com/TrinityCore/TrinityCore into 6.x
Conflicts:
src/server/collision/Management/MMapManager.cpp
src/server/game/Conditions/ConditionMgr.cpp
src/server/game/Conditions/ConditionMgr.h
Diffstat (limited to 'src/server/game/Movement')
| -rw-r--r-- | src/server/game/Movement/MotionMaster.cpp | 37 | ||||
| -rw-r--r-- | src/server/game/Movement/MotionMaster.h | 1 | ||||
| -rwxr-xr-x | src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp | 4 |
3 files changed, 40 insertions, 2 deletions
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 7eb38f3e637..5177bf5c9de 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -381,6 +381,43 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); } +void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool clockwise, uint8 stepCount) +{ + float step = 2 * float(M_PI) / stepCount * (clockwise ? -1.0f : 1.0f); + Position const& pos = { x, y, z, 0.0f }; + float angle = pos.GetAngle(_owner->GetPositionX(), _owner->GetPositionY()); + + Movement::MoveSplineInit init(_owner); + + for (uint8 i = 0; i < stepCount; angle += step, ++i) + { + G3D::Vector3 point; + point.x = x + radius * cosf(angle); + point.y = y + radius * sinf(angle); + + if (_owner->IsFlying()) + point.z = z; + else + point.z = _owner->GetMap()->GetHeight(_owner->GetPhaseMask(), point.x, point.y, z); + + init.Path().push_back(point); + } + + if (_owner->IsFlying()) + { + init.SetFly(); + init.SetCyclic(); + init.SetAnimation(Movement::ToFly); + } + else + { + init.SetWalk(true); + init.SetCyclic(); + } + + init.Launch(); +} + void MotionMaster::MoveFall(uint32 id /*=0*/) { // use larger distance for vmap height search than in most other cases diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index 2821cd5a59b..0b547d96e7f 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -184,6 +184,7 @@ class MotionMaster //: private std::stack<MovementGenerator *> void MoveJump(Position const& pos, float speedXY, float speedZ, uint32 id = EVENT_JUMP) { MoveJump(pos.m_positionX, pos.m_positionY, pos.m_positionZ, speedXY, speedZ, id); }; void MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id = EVENT_JUMP); + void MoveCirclePath(float x, float y, float z, float radius, bool clockwise, uint8 stepCount); void MoveFall(uint32 id = 0); void MoveSeekAssistance(float x, float y, float z); diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 9c17a2277c0..0222087c168 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -382,9 +382,9 @@ void FlightPathMovementGenerator::PreloadEndGrid() // Load the grid if (endMap) { - TC_LOG_INFO("misc", "Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path->size()-1)); + TC_LOG_DEBUG("misc", "Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path->size()-1)); endMap->LoadGrid(_endGridX, _endGridY); } else - TC_LOG_INFO("misc", "Unable to determine map to preload flightmaster grid"); + TC_LOG_DEBUG("misc", "Unable to determine map to preload flightmaster grid"); } |
