Fix a player's mob continuing to move after disconnecting (#1265)

This commit is contained in:
DrSmugleaf
2020-07-03 23:32:41 +02:00
committed by GitHub
parent 299b2bda6b
commit 73eb53da46
5 changed files with 10 additions and 4 deletions

View File

@@ -79,7 +79,7 @@ namespace Content.Server.GameObjects.EntitySystems
protected override void SetController(PhysicsComponent physics)
{
((PhysicsComponent) physics).SetController<MoverController>();
physics.SetController<MoverController>();
}
private static void PlayerAttached(PlayerAttachSystemMessage ev)
@@ -96,6 +96,11 @@ namespace Content.Server.GameObjects.EntitySystems
{
ev.Entity.RemoveComponent<PlayerInputMoverComponent>();
}
if (ev.Entity.TryGetComponent(out PhysicsComponent physics))
{
(physics.Controller as MoverController)?.StopMoving();
}
}
protected override void HandleFootsteps(IMoverComponent mover)