diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index 754818619ac..7abdb8d5f80 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Access; +using Content.Server.Forensics; // Corvax-Next-DoorForensics using Content.Server.Atmos.Components; using Content.Server.Atmos.EntitySystems; using Content.Shared.Doors.Components; @@ -11,6 +12,7 @@ namespace Content.Server.Doors.Systems; public sealed class DoorSystem : SharedDoorSystem { [Dependency] private readonly AirtightSystem _airtightSystem = default!; + [Dependency] private readonly ForensicsSystem _forensicsSystem = default!; // Corvax-Next-DoorForensics public override void Initialize() { @@ -50,4 +52,22 @@ private void OnBoltPowerChanged(Entity ent, ref PowerChangedE Dirty(ent, ent.Comp); UpdateBoltLightStatus(ent); } + + // Corvax-Next-DoorForensics start + public override void StartOpening(EntityUid uid, DoorComponent? door = null, EntityUid? user = null, bool predicted = false) + { + base.StartOpening(uid, door, user, predicted); + + if (user.HasValue) + _forensicsSystem.ApplyEvidence(user.Value, uid); + } + + public override void StartClosing(EntityUid uid, DoorComponent? door = null, EntityUid? user = null, bool predicted = false) + { + base.StartClosing(uid, door, user, predicted); + + if (user.HasValue) + _forensicsSystem.ApplyEvidence(user.Value, uid); + } + // Corvax-Next-DoorForensics end } diff --git a/Content.Server/Forensics/Systems/ForensicsSystem.cs b/Content.Server/Forensics/Systems/ForensicsSystem.cs index 34529aba4a2..b54ebc01380 100644 --- a/Content.Server/Forensics/Systems/ForensicsSystem.cs +++ b/Content.Server/Forensics/Systems/ForensicsSystem.cs @@ -279,7 +279,7 @@ public string GenerateDNA() return DNA; } - private void ApplyEvidence(EntityUid user, EntityUid target) + public void ApplyEvidence(EntityUid user, EntityUid target) // Corvax-Next-DoorForensics { if (HasComp(target)) return; diff --git a/Content.Shared/Doors/Systems/SharedDoorSystem.cs b/Content.Shared/Doors/Systems/SharedDoorSystem.cs index 80e7ff96698..bba1adbda7b 100644 --- a/Content.Shared/Doors/Systems/SharedDoorSystem.cs +++ b/Content.Shared/Doors/Systems/SharedDoorSystem.cs @@ -362,7 +362,7 @@ public bool CanOpen(EntityUid uid, DoorComponent? door = null, EntityUid? user = /// The user (if any) opening the door /// Whether the interaction would have been /// predicted. See comments in the PlaySound method on the Server system for details - public void StartOpening(EntityUid uid, DoorComponent? door = null, EntityUid? user = null, bool predicted = false) + public virtual void StartOpening(EntityUid uid, DoorComponent? door = null, EntityUid? user = null, bool predicted = false) // Corvax-Next-DoorForensics { if (!Resolve(uid, ref door)) return; @@ -438,7 +438,7 @@ public bool CanClose(EntityUid uid, DoorComponent? door = null, EntityUid? user return !ev.PerformCollisionCheck || !GetColliding(uid).Any(); } - public void StartClosing(EntityUid uid, DoorComponent? door = null, EntityUid? user = null, bool predicted = false) + public virtual void StartClosing(EntityUid uid, DoorComponent? door = null, EntityUid? user = null, bool predicted = false) // Corvax-Next-DoorForensics { if (!Resolve(uid, ref door)) return;