Don't consider power for docking (#9054)
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
using Content.Server.Doors.Systems;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.Shuttles.Components;
|
||||
using Content.Server.Shuttles.Events;
|
||||
using Content.Shared.Doors;
|
||||
using Content.Shared.Doors.Components;
|
||||
using Content.Shared.Shuttles.Events;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Collision.Shapes;
|
||||
@@ -35,7 +32,6 @@ namespace Content.Server.Shuttles.Systems
|
||||
_sawmill = Logger.GetSawmill("docking");
|
||||
SubscribeLocalEvent<DockingComponent, ComponentStartup>(OnStartup);
|
||||
SubscribeLocalEvent<DockingComponent, ComponentShutdown>(OnShutdown);
|
||||
SubscribeLocalEvent<DockingComponent, PowerChangedEvent>(OnPowerChange);
|
||||
SubscribeLocalEvent<DockingComponent, AnchorStateChangedEvent>(OnAnchorChange);
|
||||
SubscribeLocalEvent<DockingComponent, ReAnchorEvent>(OnDockingReAnchor);
|
||||
|
||||
@@ -73,7 +69,6 @@ namespace Content.Server.Shuttles.Systems
|
||||
var transform = body.GetTransform();
|
||||
var dockingFixture = _fixtureSystem.GetFixtureOrNull(body, DockingFixture);
|
||||
|
||||
// Happens if no power or whatever
|
||||
if (dockingFixture == null)
|
||||
return null;
|
||||
|
||||
@@ -229,22 +224,6 @@ namespace Content.Server.Shuttles.Systems
|
||||
_console.RefreshShuttleConsoles();
|
||||
}
|
||||
|
||||
private void OnPowerChange(EntityUid uid, DockingComponent component, PowerChangedEvent args)
|
||||
{
|
||||
var lifestage = MetaData(uid).EntityLifeStage;
|
||||
// This is because power can change during startup for <Reasons> and undock
|
||||
if (lifestage is < EntityLifeStage.MapInitialized or >= EntityLifeStage.Terminating) return;
|
||||
|
||||
if (args.Powered)
|
||||
{
|
||||
EnableDocking(uid, component);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisableDocking(uid, component);
|
||||
}
|
||||
}
|
||||
|
||||
private void DisableDocking(EntityUid uid, DockingComponent component)
|
||||
{
|
||||
if (!component.Enabled) return;
|
||||
|
||||
Reference in New Issue
Block a user