From b1a94bf94c500b64a5c4ae92642a95d048d9f392 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 3 Apr 2022 22:36:49 +0200 Subject: 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 --- src/server/scripts/World/npcs_special.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/server/scripts/World') diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index fe448d38124..1299df63c8b 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2398,11 +2398,13 @@ public: break; } - Movement::MoveSplineInit init(who); - init.DisableTransportPathTransformations(); - init.MoveTo(x, y, z, false); - init.SetFacing(o); - who->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_VEHICLE_BOARD, MOTION_PRIORITY_HIGHEST); + std::function initializer = [=](Movement::MoveSplineInit& init) + { + init.DisableTransportPathTransformations(); + init.MoveTo(x, y, z, false); + init.SetFacing(o); + }; + who->GetMotionMaster()->LaunchMoveSpline(std::move(initializer), EVENT_VEHICLE_BOARD, MOTION_PRIORITY_HIGHEST); who->m_Events.AddEvent(new CastFoodSpell(who, _chairSpells.at(who->GetEntry())), who->m_Events.CalculateTime(1s)); if (who->GetTypeId() == TYPEID_UNIT) who->SetDisplayId(who->ToCreature()->GetCreatureTemplate()->Modelid1); -- cgit v1.2.3