Split Door Bolt functionality out of AirlockDoor (#16354)
This commit is contained in:
@@ -7,14 +7,14 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class AirlockBolted : IGraphCondition
|
||||
public sealed class DoorBolted : IGraphCondition
|
||||
{
|
||||
[DataField("value")]
|
||||
public bool Value { get; private set; } = true;
|
||||
|
||||
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
||||
{
|
||||
if (!entityManager.TryGetComponent(uid, out AirlockComponent? airlock))
|
||||
if (!entityManager.TryGetComponent(uid, out DoorBoltComponent? airlock))
|
||||
return true;
|
||||
|
||||
return airlock.BoltsDown == Value;
|
||||
@@ -26,7 +26,7 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
if (!entMan.TryGetComponent(entity, out AirlockComponent? airlock)) return false;
|
||||
if (!entMan.TryGetComponent(entity, out DoorBoltComponent? airlock)) return false;
|
||||
|
||||
if (airlock.BoltsDown != Value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user