diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index c64a75b49..8b6e2efcd 100644 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -436,7 +436,7 @@ static Optional GetVelocity(Unit* owner, Unit* target, G3D::Vector3 const (owner->IsPet() || owner->IsGuardian() || owner->GetGUID() == target->GetCritterGUID() || owner->GetCharmerOrOwnerGUID() == target->GetGUID())) { uint32 moveFlags = target->GetUnitMovementFlags(); - if (target->movespline->isWalking()) + if (target->IsWalking()) { moveFlags |= MOVEMENTFLAG_WALKING; } @@ -635,7 +635,7 @@ bool FollowMovementGenerator::DoUpdate(T* owner, uint32 time_diff) Movement::MoveSplineInit init(owner); init.MovebyPath(i_path->GetPath()); if (_inheritWalkState) - init.SetWalk(target->IsWalking() || target->movespline->isWalking()); + init.SetWalk(target->IsWalking()); if (_inheritSpeed) if (Optional velocity = GetVelocity(owner, target, i_path->GetActualEndPosition(), owner->IsGuardian())) diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h index 40aee1254..b74d0d244 100644 --- a/src/server/game/Movement/Spline/MoveSpline.h +++ b/src/server/game/Movement/Spline/MoveSpline.h @@ -116,7 +116,6 @@ namespace Movement [[nodiscard]] bool Finalized() const { return splineflags.done; } [[nodiscard]] bool isCyclic() const { return splineflags.cyclic; } [[nodiscard]] bool isFalling() const { return splineflags.falling; } - [[nodiscard]] bool isWalking() const { return splineflags.walkmode; } [[nodiscard]] bool isBoarding() const { return splineflags.transportEnter || splineflags.transportExit; } [[nodiscard]] Vector3 FinalDestination() const { return Initialized() ? spline.getPoint(spline.last()) : Vector3(); } [[nodiscard]] Vector3 CurrentDestination() const { return Initialized() ? spline.getPoint(point_Idx + 1) : Vector3(); } diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index 3020e46c2..08c9c3d6a 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -40,7 +40,7 @@ namespace Movement Falling = 0x00000200, // Affects elevation computation, can't be combined with Parabolic flag No_Spline = 0x00000400, Parabolic = 0x00000800, // Affects elevation computation, can't be combined with Falling flag - Walkmode = 0x00001000, + CanSwim = 0x00001000, Flying = 0x00002000, // Smooth movement(Catmullrom interpolation mode), flying animation OrientationFixed = 0x00004000, // Model orientation fixed Final_Point = 0x00008000, @@ -117,7 +117,7 @@ namespace Movement bool falling : 1; bool no_spline : 1; bool parabolic : 1; - bool walkmode : 1; + bool canSwim : 1; bool flying : 1; bool orientationFixed : 1; bool final_point : 1; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 8cdb1ffdf..e1dbd9be5 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -118,7 +118,7 @@ namespace Movement // If spline is initialized with SetWalk method it only means we need to select // walk move speed for it but not add walk flag to unit uint32 moveFlagsForSpeed = moveFlags; - if (args.flags.walkmode) + if (args.walk) moveFlagsForSpeed |= MOVEMENTFLAG_WALKING; else moveFlagsForSpeed &= ~MOVEMENTFLAG_WALKING; @@ -199,7 +199,7 @@ namespace Movement args.splineId = splineIdGen.NewId(); args.TransformForTransport = unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit->GetTransGUID(); // mix existing state into new - args.flags.walkmode = unit->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); + args.walk = unit->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); args.flags.flying = unit->m_movementInfo.HasMovementFlag((MovementFlags)(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY)); } diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index e0761129c..5e26dad04 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -154,7 +154,7 @@ namespace Movement }; inline void MoveSplineInit::SetFly() { args.flags.EnableFlying(); } - inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable; } + inline void MoveSplineInit::SetWalk(bool enable) { args.walk = enable; } inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom(); } inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true; } inline void MoveSplineInit::SetFall() { args.flags.EnableFalling(); } diff --git a/src/server/game/Movement/Spline/MoveSplineInitArgs.h b/src/server/game/Movement/Spline/MoveSplineInitArgs.h index ed4a268b7..1093ca705 100644 --- a/src/server/game/Movement/Spline/MoveSplineInitArgs.h +++ b/src/server/game/Movement/Spline/MoveSplineInitArgs.h @@ -59,6 +59,7 @@ namespace Movement float initialOrientation{0.f}; bool HasVelocity{false}; bool TransformForTransport{true}; + bool walk; /** Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed. */ bool Validate(Unit* unit) const; diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp index 86f293dd3..a16fadb2c 100644 --- a/src/server/game/Movement/Spline/MovementUtil.cpp +++ b/src/server/game/Movement/Spline/MovementUtil.cpp @@ -153,7 +153,7 @@ namespace Movement STR(Falling ), // 0x00000200, // Not Compartible With Trajectory Movement STR(No_Spline ), // 0x00000400, STR(Trajectory ), // 0x00000800, // Not Compartible With Fall Movement - STR(Walkmode ), // 0x00001000, + STR(CanSwim ), // 0x00001000, STR(Flying ), // 0x00002000, // Smooth Movement(Catmullrom Interpolation Mode), Flying Animation STR(Knockback ), // 0x00004000, // Model Orientation Fixed STR(Final_Point ), // 0x00008000,