Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Открытие шлюзов всегда сохраняет отпечатки. #112

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
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
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
AwareFoxy marked this conversation as resolved.
Show resolved Hide resolved
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
AwareFoxy marked this conversation as resolved.
Show resolved Hide resolved

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
Loading