fix(emag): Emagging a lock properly unlocks the component (#25858)
* fix(emag): Emagging a lock properly unlocks the component Fixes #24860 * fix(emag): Emagging a lock no longer duplicates the unlock sound
This commit is contained in:
@@ -246,8 +246,16 @@ public sealed class LockSystem : EntitySystem
|
||||
{
|
||||
if (!component.Locked || !component.BreakOnEmag)
|
||||
return;
|
||||
_audio.PlayPredicted(component.UnlockSound, uid, null);
|
||||
|
||||
_audio.PlayPredicted(component.UnlockSound, uid, args.UserUid);
|
||||
|
||||
component.Locked = false;
|
||||
_appearanceSystem.SetData(uid, LockVisuals.Locked, false);
|
||||
Dirty(uid, component);
|
||||
|
||||
var ev = new LockToggledEvent(false);
|
||||
RaiseLocalEvent(uid, ref ev, true);
|
||||
|
||||
RemComp<LockComponent>(uid); //Literally destroys the lock as a tell it was emagged
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user