fix(Core/Entities): Knock back players if they are not under client control. (#26540)

Co-authored-by: Claude <claude@users.noreply.github.com>
Co-authored-by: sogladev <sogladev@gmail.com>
This commit is contained in:
Benjamin Jackson
2026-07-10 11:36:22 -04:00
committed by GitHub
parent edb3730f7a
commit ac071f8f5d
3 changed files with 24 additions and 7 deletions
+10 -1
View File
@@ -620,7 +620,7 @@ void MotionMaster::MoveTakeoff(uint32 id, float x, float y, float z, float speed
void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ)
{
//this function may make players fall below map
if (_owner->IsPlayer())
if (_owner->IsPlayer() && _owner->IsClientControlled())
return;
if (speedXY <= 0.1f)
@@ -640,6 +640,15 @@ void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, floa
init.SetOrientationFixed(true);
init.SetVelocity(speedXY);
// Do not mutate an active fleeing/confused movement generator,
// doing so breaks the movement upon landing from the knockback
MovementGeneratorType slotType = GetMotionSlotType(MOTION_SLOT_CONTROLLED);
if (slotType == FLEEING_MOTION_TYPE || slotType == CONFUSED_MOTION_TYPE)
{
init.Launch();
return;
}
Mutate(new EffectMovementGenerator(init, 0), MOTION_SLOT_CONTROLLED);
}