Fix disconnecting discontinuing your adventures off into deep space (#2256)

* Fix stopping when disconnecting while weightless

* Use extension
This commit is contained in:
DrSmugleaf
2020-10-14 22:46:39 +02:00
committed by GitHub
parent 50bc61b672
commit 8548e939e2
2 changed files with 4 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ namespace Content.Server.GameObjects.EntitySystems
} }
} }
private static void PlayerDetached(PlayerDetachedSystemMessage ev) private void PlayerDetached(PlayerDetachedSystemMessage ev)
{ {
if (ev.Entity.HasComponent<PlayerInputMoverComponent>()) if (ev.Entity.HasComponent<PlayerInputMoverComponent>())
{ {
@@ -84,7 +84,8 @@ namespace Content.Server.GameObjects.EntitySystems
} }
if (ev.Entity.TryGetComponent(out IPhysicsComponent? physics) && if (ev.Entity.TryGetComponent(out IPhysicsComponent? physics) &&
physics.TryGetController(out MoverController controller)) physics.TryGetController(out MoverController controller) &&
!ev.Entity.IsWeightless())
{ {
controller.StopMoving(); controller.StopMoving();
} }

View File

@@ -22,7 +22,7 @@ namespace Content.Shared.GameObjects.EntitySystems
public abstract class SharedMoverSystem : EntitySystem public abstract class SharedMoverSystem : EntitySystem
{ {
[Dependency] private readonly IEntityManager _entityManager = default!; [Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IPhysicsManager _physicsManager = default!; [Dependency] protected readonly IPhysicsManager PhysicsManager = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!; [Dependency] private readonly IConfigurationManager _configurationManager = default!;
public override void Initialize() public override void Initialize()