diff options
| author | Shauren <shauren.trinity@gmail.com> | 2022-04-03 22:36:49 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-06-10 15:16:39 +0200 |
| commit | 36dde87249e87c5693162a6e890875d828f93d6d (patch) | |
| tree | 6b715382a474deb81b8179aeef1c45533e684b5d /src/server/scripts/EasternKingdoms | |
| parent | 54b16f0d167a0c5a37c91dd7140fe97597a66ac8 (diff) | |
Core/Movement: Delay creating MoveSplineInit objects used by GenericMovementGenerator to spline launch time
* This fixes inconsistent transport state detection for players exiting vehicles that are on transport (ICC gunship battle), fixes players being telerpoted to middle of nowhere on that fight
(cherry picked from commit b1a94bf94c500b64a5c4ae92642a95d048d9f392)
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
| -rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 2cd9a7f17ac..09331dc0fa5 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -476,14 +476,16 @@ struct npc_eye_of_acherus : public ScriptedAI break; case EVENT_LAUNCH_TOWARDS_DESTINATION: { - Movement::PointsArray path(EyeOfAcherusPath, EyeOfAcherusPath + EyeOfAcherusPathSize); - Movement::MoveSplineInit init(me); - init.MovebyPath(path); - init.SetFly(); - if (Unit* owner = me->GetCharmerOrOwner()) - init.SetVelocity(owner->GetSpeed(MOVE_RUN)); - - me->GetMotionMaster()->LaunchMoveSpline(std::move(init), POINT_NEW_AVALON, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE); + std::function<void(Movement::MoveSplineInit&)> initializer = [=](Movement::MoveSplineInit& init) + { + Movement::PointsArray path(EyeOfAcherusPath, EyeOfAcherusPath + EyeOfAcherusPathSize); + init.MovebyPath(path); + init.SetFly(); + if (Unit* owner = me->GetCharmerOrOwner()) + init.SetVelocity(owner->GetSpeed(MOVE_RUN)); + }; + + me->GetMotionMaster()->LaunchMoveSpline(std::move(initializer), POINT_NEW_AVALON, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE); break; } case EVENT_GRANT_CONTROL: |
