diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 3a6bb58b3..8b9692230 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1759,6 +1759,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // reset movement flags at teleport, because player will continue move with these flags after teleport m_movementInfo.SetMovementFlags(MOVEFLAG_NONE); + DisableSpline(); if ((GetMapId() == mapid) && (!m_transport)) { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index fa1289f38..ea6797ba1 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10393,6 +10393,8 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update) void Unit::NearTeleportTo( float x, float y, float z, float orientation, bool casting /*= false*/ ) { + DisableSpline(); + if(GetTypeId() == TYPEID_PLAYER) ((Player*)this)->TeleportTo(GetMapId(), x, y, z, orientation, TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (casting ? TELE_TO_SPELL : 0)); else @@ -10808,7 +10810,7 @@ void Unit::UpdateSplineMovement(uint32 t_diff) bool arrived = movespline->Finalized(); if (arrived) - m_movementInfo.RemoveMovementFlag(MovementFlags(MOVEFLAG_SPLINE_ENABLED|MOVEFLAG_FORWARD)); + DisableSpline(); m_movesplineTimer.Update(t_diff); if (m_movesplineTimer.Passed() || arrived) @@ -10822,3 +10824,9 @@ void Unit::UpdateSplineMovement(uint32 t_diff) GetMap()->CreatureRelocation((Creature*)this,loc.x,loc.y,loc.z,loc.orientation); } } + +void Unit::DisableSpline() +{ + m_movementInfo.RemoveMovementFlag(MovementFlags(MOVEFLAG_SPLINE_ENABLED|MOVEFLAG_FORWARD)); + movespline->_Interrupt(); +} diff --git a/src/game/Unit.h b/src/game/Unit.h index 6da1c7651..b808d39f7 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -2010,6 +2010,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject private: void CleanupDeletedAuras(); void UpdateSplineMovement(uint32 t_diff); + void DisableSpline(); // player or player's pet float GetCombatRatingReduction(CombatRating cr) const; diff --git a/src/game/movement/MoveSpline.h b/src/game/movement/MoveSpline.h index 553d367ef..3ee5b49ad 100644 --- a/src/game/movement/MoveSpline.h +++ b/src/game/movement/MoveSpline.h @@ -85,6 +85,7 @@ namespace Movement const MySpline& _Spline() const { return spline;} int32 _currentSplineIdx() const { return point_Idx;} void _Finalize(); + void _Interrupt() { splineflags.done = true;} #pragma endregion public: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ff3b628e9..1986c24eb 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11726" + #define REVISION_NR "11727" #endif // __REVISION_NR_H__