Core/Movement: allow MotionMaster::MovePoint to use velocity arguments and implement speed paramemters for SMART_ACTION_MOVE_OFFSET and SMART_ACTION_MOVE_TO_POS

This commit is contained in:
Ovahlord committed 2020-10-30 18:57:09 +01:00
1 parent 9320382d90
commit 961f82988d
4 files changed
+19 -9

No files matched your search

+3 -3
View File
@@ -309,17 +309,17 @@ void MotionMaster::MoveFleeing(Unit* enemy, uint32 time)
Mutate(new FleeingMovementGenerator<Player>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED);
}
void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generatePath)
void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generatePath, float speed)
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MovePoint: '%s', targeted point Id: %u (X: %f, Y: %f, Z: %f)", _owner->GetGUID().ToString().c_str(), id, x, y, z);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, generatePath, 0.0f), MOTION_SLOT_ACTIVE);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, generatePath, speed), MOTION_SLOT_ACTIVE);
}
else
{
TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MovePoint: '%s', targeted point Id: %u (X: %f, Y: %f, Z: %f)", _owner->GetGUID().ToString().c_str(), id, x, y, z);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, generatePath, 0.0f), MOTION_SLOT_ACTIVE);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, generatePath, speed), MOTION_SLOT_ACTIVE);
}
}