Fix camera recoil system overriding all other eye offsets (#29146)

This commit is contained in:
DrSmugleaf
2024-07-02 19:51:16 -07:00
committed by GitHub
parent ae4cff4982
commit c6d718d126
3 changed files with 59 additions and 10 deletions

View File

@@ -0,0 +1,19 @@
using System.Numerics;
using Content.Shared.Movement.Systems;
namespace Content.Shared.Camera;
/// <summary>
/// Raised directed by-ref when <see cref="SharedContentEyeSystem.UpdateEyeOffset"/> is called.
/// Should be subscribed to by any systems that want to modify an entity's eye offset,
/// so that they do not override each other.
/// </summary>
/// <param name="Offset">
/// The total offset to apply.
/// </param>
/// <remarks>
/// Note that in most cases <see cref="Offset"/> should be incremented or decremented by subscribers, not set.
/// Otherwise, any offsets applied by previous subscribing systems will be overridden.
/// </remarks>
[ByRefEvent]
public record struct GetEyeOffsetEvent(Vector2 Offset);