mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-06-09 13:26:34 +02:00
22a547c7c8
* Replace usages of EntityQuery with dependency injected ones in Content.Server * Remove unused EntityQuery dependencies * Restore CheckPressureAndFire override method * Revert EntityQuery refactor changes to DisposalTubeSystem.cs & DisposableSystem.cs * Infer Transform/Metadata directly instead of passing (#43479) * Resolve RA0049, RA0051 errors (#43479) * Resolve RA0049, RA0051 errors (#43479) * Apply suggestions from code review Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using System.Numerics;
|
|
using Content.Shared.CCVar;
|
|
using Content.Shared.Movement.Systems;
|
|
using Robust.Client.Player;
|
|
using Robust.Shared.Timing;
|
|
|
|
namespace Content.Client.Movement.Systems;
|
|
|
|
public sealed partial class MobCollisionSystem : SharedMobCollisionSystem
|
|
{
|
|
[Dependency] private IGameTiming _timing = default!;
|
|
[Dependency] private IPlayerManager _player = default!;
|
|
|
|
public override void Update(float frameTime)
|
|
{
|
|
if (!CfgManager.GetCVar(CCVars.MovementMobPushing))
|
|
return;
|
|
|
|
if (_timing.IsFirstTimePredicted)
|
|
{
|
|
var player = _player.LocalEntity;
|
|
|
|
if (MobQuery.TryComp(player, out var comp) && PhysicsQuery.TryComp(player, out var physics))
|
|
{
|
|
HandleCollisions((player.Value, comp, physics), frameTime);
|
|
}
|
|
}
|
|
|
|
base.Update(frameTime);
|
|
}
|
|
|
|
protected override void RaiseCollisionEvent(EntityUid uid, Vector2 direction, float speedMod)
|
|
{
|
|
RaisePredictiveEvent(new MobCollisionMessage()
|
|
{
|
|
Direction = direction,
|
|
SpeedModifier = speedMod,
|
|
});
|
|
}
|
|
}
|