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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user