fix(Core/Spell): Improvements to path generation for Charge mechanic (#11534)

It has its flaws but it can be improved and it's actually a lot better than what we currently have.
This commit is contained in:
IntelligentQuantum
2022-04-28 03:48:44 +04:30
committed by GitHub
parent ad8f8ee5a5
commit 59e45c251e
7 changed files with 44 additions and 41 deletions

View File

@@ -608,6 +608,19 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id,
}
}
void MotionMaster::MoveCharge(PathGenerator const& path, float speed /*= SPEED_CHARGE*/)
{
G3D::Vector3 dest = path.GetActualEndPosition();
MoveCharge(dest.x, dest.y, dest.z, speed, EVENT_CHARGE_PREPATH);
// Charge movement is not started when using EVENT_CHARGE_PREPATH
Movement::MoveSplineInit init(_owner);
init.MovebyPath(path.GetPath());
init.SetVelocity(speed);
init.Launch();
}
void MotionMaster::MoveSeekAssistance(float x, float y, float z)
{
// Xinef: do not allow to move with UNIT_FLAG_DISABLE_MOVE