Skip to content

Commit

Permalink
DoorForensics
Browse files Browse the repository at this point in the history
  • Loading branch information
Vonsant committed Dec 2, 2024
1 parent ffcfb00 commit 1ca50ba
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
20 changes: 20 additions & 0 deletions Content.Server/Doors/Systems/DoorSystem.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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()
{
Expand Down Expand Up @@ -50,4 +52,22 @@ private void OnBoltPowerChanged(Entity<DoorBoltComponent> 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
}
2 changes: 1 addition & 1 deletion Content.Server/Forensics/Systems/ForensicsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IgnoresFingerprintsComponent>(target))
return;
Expand Down
4 changes: 2 additions & 2 deletions Content.Shared/Doors/Systems/SharedDoorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public bool CanOpen(EntityUid uid, DoorComponent? door = null, EntityUid? user =
/// <param name="user"> The user (if any) opening the door</param>
/// <param name="predicted">Whether the interaction would have been
/// predicted. See comments in the PlaySound method on the Server system for details</param>
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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1ca50ba

Please sign in to comment.