Welding tweaks (#27959)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user