mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 07:36:23 +00:00
fix(Core/Movement): Rename walkmode flag to proper name canswim and resolve issues (#24410)
This commit is contained in:
@@ -436,7 +436,7 @@ static Optional<float> 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<T>::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<float> velocity = GetVelocity(owner, target, i_path->GetActualEndPosition(), owner->IsGuardian()))
|
||||
|
||||
@@ -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(); }
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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(); }
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user