Openable refactor (#19750)

This commit is contained in:
deltanedas
2023-09-23 03:10:04 +01:00
committed by GitHub
parent 71ab660885
commit b7cff81587
33 changed files with 842 additions and 687 deletions

View File

@@ -1,6 +1,6 @@
using Content.Server.Administration.Logs;
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Nutrition.Components;
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.Database;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction;
@@ -23,7 +23,7 @@ public sealed class LubeSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<LubeComponent, AfterInteractEvent>(OnInteract);
SubscribeLocalEvent<LubeComponent, AfterInteractEvent>(OnInteract, after: new[] { typeof(OpenableSystem) });
}
private void OnInteract(EntityUid uid, LubeComponent component, AfterInteractEvent args)
@@ -34,11 +34,6 @@ public sealed class LubeSystem : EntitySystem
if (!args.CanReach || args.Target is not { Valid: true } target)
return;
if (TryComp<DrinkComponent>(uid, out var drink) && !drink.Opened)
{
return;
}
if (TryLube(uid, component, target, args.User))
{
args.Handled = true;