Skip to content

Commit

Permalink
Revert "Firelocks are no longer pryable by hand if they are powered (…
Browse files Browse the repository at this point in the history
…#29221)"

This reverts commit 6aced66406ee61765a28a66ed83b370de29bb001.
  • Loading branch information
deltanedas committed Sep 16, 2024
1 parent d27668e commit 9ef2c54
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
9 changes: 0 additions & 9 deletions Content.Shared/Doors/Systems/SharedFirelockSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public override void Initialize()

// Access/Prying
SubscribeLocalEvent<FirelockComponent, BeforeDoorOpenedEvent>(OnBeforeDoorOpened);
SubscribeLocalEvent<FirelockComponent, BeforePryEvent>(OnBeforePry);
SubscribeLocalEvent<FirelockComponent, GetPryTimeModifierEvent>(OnDoorGetPryTimeModifier);
SubscribeLocalEvent<FirelockComponent, PriedEvent>(OnAfterPried);

Expand Down Expand Up @@ -61,14 +60,6 @@ private void OnBeforeDoorOpened(EntityUid uid, FirelockComponent component, Befo
WarnPlayer((uid, component), args.User.Value);
}

private void OnBeforePry(EntityUid uid, FirelockComponent component, ref BeforePryEvent args)
{
if (args.Cancelled || !component.Powered || args.StrongPry || args.PryPowered)
return;

args.Cancelled = true;
}

private void OnDoorGetPryTimeModifier(EntityUid uid, FirelockComponent component, ref GetPryTimeModifierEvent args)
{
WarnPlayer((uid, component), args.User);
Expand Down
14 changes: 1 addition & 13 deletions Content.Shared/Prying/Components/PryingComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,14 @@ public sealed partial class PryingComponent : Component
/// Cancel to stop the entity from being pried open.
/// </summary>
[ByRefEvent]
public record struct BeforePryEvent(EntityUid User, bool PryPowered, bool Force, bool StrongPry)
public record struct BeforePryEvent(EntityUid User, bool PryPowered, bool Force)
{
public readonly EntityUid User = User;

/// <summary>
/// Whether prying should be allowed even if whatever is being pried is powered.
/// </summary>
public readonly bool PryPowered = PryPowered;

/// <summary>
/// Whether prying should be allowed to go through under most circumstances. (E.g. airlock is bolted).
/// Systems may still wish to ignore this occasionally.
/// </summary>
public readonly bool Force = Force;

/// <summary>
/// Whether anything other than bare hands were used. This should only be false if prying is being performed without a prying comp.
/// </summary>
public readonly bool StrongPry = StrongPry;

public string? Message;

public bool Cancelled;
Expand Down
4 changes: 2 additions & 2 deletions Content.Shared/Prying/Systems/PryingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private bool CanPry(EntityUid target, EntityUid user, out string? message, Pryin

if (comp != null || Resolve(user, ref comp, false))
{
canev = new BeforePryEvent(user, comp.PryPowered, comp.Force, true);
canev = new BeforePryEvent(user, comp.PryPowered, comp.Force);
}
else
{
Expand All @@ -119,7 +119,7 @@ private bool CanPry(EntityUid target, EntityUid user, out string? message, Pryin
return false;
}

canev = new BeforePryEvent(user, false, false, false);
canev = new BeforePryEvent(user, false, false);
}

RaiseLocalEvent(target, ref canev);
Expand Down

0 comments on commit 9ef2c54

Please sign in to comment.