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

@@ -5,7 +5,7 @@ using Content.Shared.Item;
using Content.Shared.Glue;
using Content.Shared.Interaction;
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Nutrition.Components;
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.Database;
using Content.Shared.Hands;
using Robust.Shared.Timing;
@@ -26,7 +26,7 @@ public sealed class GlueSystem : SharedGlueSystem
{
base.Initialize();
SubscribeLocalEvent<GlueComponent, AfterInteractEvent>(OnInteract);
SubscribeLocalEvent<GlueComponent, AfterInteractEvent>(OnInteract, after: new[] { typeof(OpenableSystem) });
SubscribeLocalEvent<GluedComponent, ComponentInit>(OnGluedInit);
SubscribeLocalEvent<GluedComponent, GotEquippedHandEvent>(OnHandPickUp);
}
@@ -40,11 +40,6 @@ public sealed class GlueSystem : SharedGlueSystem
if (!args.CanReach || args.Target is not { Valid: true } target)
return;
if (TryComp<DrinkComponent>(uid, out var drink) && !drink.Opened)
{
return;
}
if (TryGlue(uid, component, target, args.User))
{
args.Handled = true;