Files
tbd-station-14/Content.Client/GameObjects/EntitySystems/MoverSystem.cs
DrSmugleaf b64cb24059 Rename usages of collidable to physics (#2230)
* Rename usages of collidable to physics

* high tier PANIQUE

* aaaaaaaaAAAAAa

* cursed commit dont research

* Fix urist and items being anchored

* Fix the rest
2020-10-11 16:36:58 +02:00

45 lines
1.2 KiB
C#

#nullable enable
using Content.Shared.GameObjects.Components.Movement;
using Content.Shared.GameObjects.EntitySystems;
using JetBrains.Annotations;
using Robust.Client.Physics;
using Robust.Client.Player;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.IoC;
namespace Content.Client.GameObjects.EntitySystems
{
[UsedImplicitly]
public class MoverSystem : SharedMoverSystem
{
[Dependency] private readonly IPlayerManager _playerManager = default!;
public override void Initialize()
{
base.Initialize();
UpdatesBefore.Add(typeof(PhysicsSystem));
}
public override void FrameUpdate(float frameTime)
{
var playerEnt = _playerManager.LocalPlayer?.ControlledEntity;
if (playerEnt == null || !playerEnt.TryGetComponent(out IMoverComponent? mover))
{
return;
}
var physics = playerEnt.GetComponent<IPhysicsComponent>();
physics.Predict = true;
UpdateKinematics(playerEnt.Transform, mover, physics);
}
public override void Update(float frameTime)
{
FrameUpdate(frameTime);
}
}
}