Fix whatever the fuck is going on in storage system slightly (#28236)
* Fix whatever the fuck is going on in storage system slightly * Fix inverted check * h * Add silent bool * Silent
This commit is contained in:
@@ -8,6 +8,7 @@ using Content.Shared.Hands.Components;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Wires;
|
||||
@@ -42,11 +43,13 @@ public sealed class LockSystem : EntitySystem
|
||||
SubscribeLocalEvent<LockComponent, GotEmaggedEvent>(OnEmagged);
|
||||
SubscribeLocalEvent<LockComponent, LockDoAfter>(OnDoAfterLock);
|
||||
SubscribeLocalEvent<LockComponent, UnlockDoAfter>(OnDoAfterUnlock);
|
||||
SubscribeLocalEvent<LockComponent, StorageInteractAttemptEvent>(OnStorageInteractAttempt);
|
||||
|
||||
SubscribeLocalEvent<LockedWiresPanelComponent, LockToggleAttemptEvent>(OnLockToggleAttempt);
|
||||
SubscribeLocalEvent<LockedWiresPanelComponent, AttemptChangePanelEvent>(OnAttemptChangePanel);
|
||||
SubscribeLocalEvent<LockedAnchorableComponent, UnanchorAttemptEvent>(OnUnanchorAttempt);
|
||||
}
|
||||
|
||||
private void OnStartup(EntityUid uid, LockComponent lockComp, ComponentStartup args)
|
||||
{
|
||||
_appearanceSystem.SetData(uid, LockVisuals.Locked, lockComp.Locked);
|
||||
@@ -293,6 +296,12 @@ public sealed class LockSystem : EntitySystem
|
||||
TryUnlock(uid, args.User, skipDoAfter: true);
|
||||
}
|
||||
|
||||
private void OnStorageInteractAttempt(Entity<LockComponent> ent, ref StorageInteractAttemptEvent args)
|
||||
{
|
||||
if (ent.Comp.Locked)
|
||||
args.Cancelled = true;
|
||||
}
|
||||
|
||||
private void OnLockToggleAttempt(Entity<LockedWiresPanelComponent> ent, ref LockToggleAttemptEvent args)
|
||||
{
|
||||
if (args.Cancelled)
|
||||
|
||||
Reference in New Issue
Block a user