Weldable cleanup (#19809)

This commit is contained in:
metalgearsloth
2023-09-05 00:07:01 +10:00
committed by GitHub
parent 88454b046a
commit db1ff07821
24 changed files with 159 additions and 210 deletions

View File

@@ -3,7 +3,6 @@ using Content.Server.Explosion.EntitySystems;
using Content.Server.Resist;
using Content.Server.Station.Components;
using Content.Server.Storage.Components;
using Content.Server.Tools.Systems;
using Content.Shared.Access.Components;
using Content.Shared.Coordinates;
using Content.Shared.DoAfter;
@@ -11,6 +10,7 @@ using Content.Shared.Lock;
using Content.Shared.Mind.Components;
using Content.Shared.Storage.Components;
using Content.Shared.Storage.EntitySystems;
using Content.Shared.Tools.Systems;
using Robust.Shared.Random;
using Robust.Shared.Timing;
@@ -327,13 +327,12 @@ public sealed class BluespaceLockerSystem : EntitySystem
}
else
{
if (target.Value.storageComponent.IsWeldedShut)
if (_weldableSystem.IsWelded(target.Value.uid))
{
// It gets bluespaced open...
_weldableSystem.ForceWeldedState(target.Value.uid, false);
if (target.Value.storageComponent.IsWeldedShut)
target.Value.storageComponent.IsWeldedShut = false;
_weldableSystem.SetWeldedState(target.Value.uid, false);
}
LockComponent? lockComponent = null;
if (Resolve(target.Value.uid, ref lockComponent, false) && lockComponent.Locked)
_lockSystem.Unlock(target.Value.uid, target.Value.uid, lockComponent);

View File

@@ -3,7 +3,6 @@ using Content.Server.Atmos.EntitySystems;
using Content.Server.Construction;
using Content.Server.Construction.Components;
using Content.Server.Storage.Components;
using Content.Server.Tools.Systems;
using Content.Shared.Destructible;
using Content.Shared.Foldable;
using Content.Shared.Interaction;
@@ -11,6 +10,7 @@ using Content.Shared.Lock;
using Content.Shared.Movement.Events;
using Content.Shared.Storage.Components;
using Content.Shared.Storage.EntitySystems;
using Content.Shared.Tools.Systems;
using Content.Shared.Verbs;
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
@@ -44,7 +44,6 @@ public sealed class EntityStorageSystem : SharedEntityStorageSystem
SubscribeLocalEvent<EntityStorageComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<EntityStorageComponent, WeldableAttemptEvent>(OnWeldableAttempt);
SubscribeLocalEvent<EntityStorageComponent, WeldableChangedEvent>(OnWelded);
SubscribeLocalEvent<InsideEntityStorageComponent, InhaleLocationEvent>(OnInsideInhale);
SubscribeLocalEvent<InsideEntityStorageComponent, ExhaleLocationEvent>(OnInsideExhale);
@@ -97,12 +96,6 @@ public sealed class EntityStorageSystem : SharedEntityStorageSystem
}
}
private void OnWelded(EntityUid uid, EntityStorageComponent component, WeldableChangedEvent args)
{
component.IsWeldedShut = args.IsWelded;
Dirty(component);
}
protected override void TakeGas(EntityUid uid, SharedEntityStorageComponent component)
{
if (!component.Airtight)