Welding tweaks (#27959)

This commit is contained in:
Verm
2024-06-02 22:28:53 -05:00
committed by GitHub
parent 509e3aedf7
commit 31eb3ed62c
33 changed files with 139 additions and 141 deletions

View File

@@ -1,6 +1,7 @@
using Content.Shared.Configurable;
using Content.Shared.Interaction;
using Content.Shared.Tools.Components;
using Content.Shared.Tools.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
using Robust.Shared.Player;
@@ -11,6 +12,7 @@ namespace Content.Server.Configurable;
public sealed class ConfigurationSystem : EntitySystem
{
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
public override void Initialize()
{
@@ -28,7 +30,7 @@ public sealed class ConfigurationSystem : EntitySystem
if (args.Handled)
return;
if (!TryComp(args.Used, out ToolComponent? tool) || !tool.Qualities.Contains(component.QualityNeeded))
if (!_toolSystem.HasQuality(args.Used, component.QualityNeeded))
return;
args.Handled = _uiSystem.TryOpenUi(uid, ConfigurationUiKey.Key, args.User);
@@ -68,7 +70,7 @@ public sealed class ConfigurationSystem : EntitySystem
private void OnInsert(EntityUid uid, ConfigurationComponent component, ContainerIsInsertingAttemptEvent args)
{
if (!TryComp(args.EntityUid, out ToolComponent? tool) || !tool.Qualities.Contains(component.QualityNeeded))
if (!_toolSystem.HasQuality(args.EntityUid, component.QualityNeeded))
return;
args.Cancel();