Firelocks only open on click (not close) (#16516)

This commit is contained in:
Tom Leys
2023-05-17 18:37:37 +12:00
committed by GitHub
parent ae926b0dba
commit 9fce417662
3 changed files with 35 additions and 36 deletions

View File

@@ -27,7 +27,6 @@ namespace Content.Server.Doors.Systems;
public sealed class DoorSystem : SharedDoorSystem
{
[Dependency] private readonly AccessReaderSystem _accessReaderSystem = default!;
[Dependency] private readonly AirlockSystem _airlock = default!;
[Dependency] private readonly AirtightSystem _airtightSystem = default!;
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
@@ -208,34 +207,6 @@ public sealed class DoorSystem : SharedDoorSystem
}
#endregion
/// <summary>
/// Does the user have the permissions required to open this door?
/// </summary>
public override bool HasAccess(EntityUid uid, EntityUid? user = null, AccessReaderComponent? access = null)
{
// TODO network AccessComponent for predicting doors
// if there is no "user" we skip the access checks. Access is also ignored in some game-modes.
if (user == null || AccessType == AccessTypes.AllowAll)
return true;
// If the door is on emergency access we skip the checks.
if (TryComp<AirlockComponent>(uid, out var airlock) && airlock.EmergencyAccess)
return true;
if (!Resolve(uid, ref access, false))
return true;
var isExternal = access.AccessLists.Any(list => list.Contains("External"));
return AccessType switch
{
// Some game modes modify access rules.
AccessTypes.AllowAllIdExternal => !isExternal || _accessReaderSystem.IsAllowed(user.Value, access),
AccessTypes.AllowAllNoExternal => !isExternal,
_ => _accessReaderSystem.IsAllowed(user.Value, access)
};
}
/// <summary>
/// Open a door if a player or door-bumper (PDA, ID-card) collide with the door. Sadly, bullets no longer