Lipid Extractor (#15597)
This commit is contained in:
@@ -34,6 +34,12 @@ public sealed class LockComponent : Component
|
||||
/// </summary>
|
||||
[DataField("lockingSound"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public SoundSpecifier LockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_on.ogg");
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not an emag disables it.
|
||||
/// </summary>
|
||||
[DataField("breakOnEmag")]
|
||||
public bool BreakOnEmag = true;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
@@ -203,7 +203,7 @@ public sealed class LockSystem : EntitySystem
|
||||
private bool HasUserAccess(EntityUid uid, EntityUid user, AccessReaderComponent? reader = null, bool quiet = true)
|
||||
{
|
||||
// Not having an AccessComponent means you get free access. woo!
|
||||
if (!Resolve(uid, ref reader))
|
||||
if (!Resolve(uid, ref reader, false))
|
||||
return true;
|
||||
|
||||
if (_accessReader.IsAllowed(user, reader))
|
||||
@@ -234,7 +234,7 @@ public sealed class LockSystem : EntitySystem
|
||||
|
||||
private void OnEmagged(EntityUid uid, LockComponent component, ref GotEmaggedEvent args)
|
||||
{
|
||||
if (!component.Locked)
|
||||
if (!component.Locked || !component.BreakOnEmag)
|
||||
return;
|
||||
_audio.PlayPredicted(component.UnlockSound, uid, null, AudioParams.Default.WithVolume(-5));
|
||||
_appearanceSystem.SetData(uid, StorageVisuals.Locked, false);
|
||||
|
||||
Reference in New Issue
Block a user