Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Content.Shared/Camera/SharedCameraRecoilSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ public override void Initialize()

private void OnCameraRecoilGetEyeOffset(Entity<CameraRecoilComponent> ent, ref GetEyeOffsetEvent args)
{
// NaN fixes. The check allows you to avoid a fatal client error when shooting at an object from zero distance.
if (!float.IsFinite(ent.Comp.CurrentKick.X) || !float.IsFinite(ent.Comp.CurrentKick.Y))
{
ent.Comp.CurrentKick = Vector2.Zero;
}

args.Offset += ent.Comp.BaseOffset + ent.Comp.CurrentKick;
}

Expand Down
Loading