Add conditional camera offset based on cursor - Hristov Rework, Part 1 (#31626)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System.Numerics;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -28,7 +30,7 @@ public abstract class SharedCameraRecoilSystem : EntitySystem
|
||||
/// </summary>
|
||||
protected const float KickMagnitudeMax = 1f;
|
||||
|
||||
[Dependency] private readonly SharedEyeSystem _eye = default!;
|
||||
[Dependency] private readonly SharedContentEyeSystem _eye = default!;
|
||||
[Dependency] private readonly INetManager _net = default!;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -81,9 +83,7 @@ public abstract class SharedCameraRecoilSystem : EntitySystem
|
||||
continue;
|
||||
|
||||
recoil.LastKick = recoil.CurrentKick;
|
||||
var ev = new GetEyeOffsetEvent();
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
_eye.SetOffset(uid, ev.Offset, eye);
|
||||
_eye.UpdateEyeOffset((uid, eye));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user