Split Door Bolt functionality out of AirlockDoor (#16354)

This commit is contained in:
Tom Leys
2023-06-01 02:23:35 +12:00
committed by GitHub
parent f419c20c49
commit a196756124
26 changed files with 283 additions and 161 deletions

View File

@@ -18,7 +18,7 @@ namespace Content.Server.Shuttles.Systems
public sealed partial class DockingSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly AirlockSystem _airlocks = default!;
[Dependency] private readonly DoorBoltSystem _bolts = default!;
[Dependency] private readonly DoorSystem _doorSystem = default!;
[Dependency] private readonly FixtureSystem _fixtureSystem = default!;
[Dependency] private readonly PathfindingSystem _pathfinding = default!;
@@ -355,9 +355,9 @@ namespace Content.Server.Shuttles.Systems
if (_doorSystem.TryOpen(dockAUid, doorA))
{
doorA.ChangeAirtight = false;
if (TryComp<AirlockComponent>(dockAUid, out var airlockA))
if (TryComp<DoorBoltComponent>(dockAUid, out var airlockA))
{
_airlocks.SetBoltsWithAudio(dockAUid, airlockA, true);
_bolts.SetBoltsWithAudio(dockAUid, airlockA, true);
}
}
}
@@ -367,9 +367,9 @@ namespace Content.Server.Shuttles.Systems
if (_doorSystem.TryOpen(dockBUid, doorB))
{
doorB.ChangeAirtight = false;
if (TryComp<AirlockComponent>(dockBUid, out var airlockB))
if (TryComp<DoorBoltComponent>(dockBUid, out var airlockB))
{
_airlocks.SetBoltsWithAudio(dockBUid, airlockB, true);
_bolts.SetBoltsWithAudio(dockBUid, airlockB, true);
}
}
}
@@ -453,14 +453,14 @@ namespace Content.Server.Shuttles.Systems
if (dock.DockedWith == null)
return;
if (TryComp<AirlockComponent>(dockUid, out var airlockA))
if (TryComp<DoorBoltComponent>(dockUid, out var airlockA))
{
_airlocks.SetBoltsWithAudio(dockUid, airlockA, false);
_bolts.SetBoltsWithAudio(dockUid, airlockA, false);
}
if (TryComp<AirlockComponent>(dock.DockedWith, out var airlockB))
if (TryComp<DoorBoltComponent>(dock.DockedWith, out var airlockB))
{
_airlocks.SetBoltsWithAudio(dock.DockedWith.Value, airlockB, false);
_bolts.SetBoltsWithAudio(dock.DockedWith.Value, airlockB, false);
}
if (TryComp(dockUid, out DoorComponent? doorA))

View File

@@ -393,7 +393,7 @@ public sealed partial class ShuttleSystem
private void SetDockBolts(EntityUid uid, bool enabled)
{
var query = AllEntityQuery<DockingComponent, AirlockComponent, TransformComponent>();
var query = AllEntityQuery<DockingComponent, DoorBoltComponent, TransformComponent>();
while (query.MoveNext(out var doorUid, out _, out var door, out var xform))
{
@@ -401,7 +401,7 @@ public sealed partial class ShuttleSystem
continue;
_doors.TryClose(doorUid);
_airlock.SetBoltsWithAudio(doorUid, door, enabled);
_bolts.SetBoltsWithAudio(doorUid, door, enabled);
}
}

View File

@@ -23,10 +23,10 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly AirlockSystem _airlock = default!;
[Dependency] private readonly BodySystem _bobby = default!;
[Dependency] private readonly DockingSystem _dockSystem = default!;
[Dependency] private readonly DoorSystem _doors = default!;
[Dependency] private readonly DoorBoltSystem _bolts = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly FixtureSystem _fixtures = default!;
[Dependency] private readonly MapLoaderSystem _loader = default!;