Fix emitter lock toggle (#5066)

This commit is contained in:
Leon Friedrich
2021-10-29 00:29:19 +13:00
committed by GitHub
parent 94579d1877
commit 5dd73ff6e0
7 changed files with 11 additions and 51 deletions

View File

@@ -126,9 +126,12 @@ namespace Content.Server.Lock
return true;
}
/// <summary>
/// Before locking the entity, check whether it's a locker. If is, prevent it from being locked from the inside or while it is open.
/// </summary>
public bool CanToggleLock(EntityUid uid, IEntity user, EntityStorageComponent? storage = null, bool quiet = true)
{
if (!Resolve(uid, ref storage))
if (!Resolve(uid, ref storage, logMissing: false))
return true;
// Cannot lock if the entity is currently opened.