From 844450d542b042338a242cd78c1691c33e1ba35c Mon Sep 17 00:00:00 2001 From: Ovalord <1Don7H4v3@m41L.com> Date: Wed, 14 Feb 2018 14:41:34 +0100 Subject: [PATCH] Core/Movement: don't stop movements on stuns when the target is currently affected by parabolic splines --- src/server/game/Entities/Unit/Unit.cpp | 8 ++++---- src/server/game/Movement/Spline/MoveSpline.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index cc843ab42b..d9ed57c793 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11835,8 +11835,8 @@ void Unit::SetStunned(bool apply) SetTarget(ObjectGuid::Empty); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); - // Stop movement if unit is affected by point motion master - if (GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) + // Stop movement if unit is affected by parabolic splines (eg. knockbacks, pulls, etc.) + if (!movespline->isParabolic()) StopMoving(); if (GetTypeId() == TYPEID_PLAYER) @@ -11871,8 +11871,8 @@ void Unit::SetRooted(bool apply, bool packetOnly /*= false*/) // setting MOVEMENTFLAG_ROOT RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING); AddUnitMovementFlag(MOVEMENTFLAG_ROOT); - // Stop movement if unit is affected by point motion master - if (GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) + // Stop movement if unit is affected by parabolic splines (eg. knockbacks, pulls, etc.) + if (!movespline->isParabolic()) StopMoving(); } else diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h index f28f8a38e0..28ac14b0f6 100644 --- a/src/server/game/Movement/Spline/MoveSpline.h +++ b/src/server/game/Movement/Spline/MoveSpline.h @@ -117,6 +117,7 @@ namespace Movement bool Finalized() const { return splineflags.done; } bool isCyclic() const { return splineflags.cyclic; } bool isFalling() const { return splineflags.falling; } + bool isParabolic() const { return splineflags.parabolic; } Vector3 FinalDestination() const { return Initialized() ? spline.getPoint(spline.last()) : Vector3(); } Vector3 CurrentDestination() const { return Initialized() ? spline.getPoint(point_Idx + 1) : Vector3(); } int32 currentPathIdx() const;