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

@@ -2,6 +2,7 @@
using Content.Shared.Interaction;
using Content.Shared.Tag;
using Content.Shared.Tools.Components;
using Content.Shared.Tools.Systems;
using Robust.Server.Containers;
using Robust.Shared.Containers;
@@ -15,6 +16,7 @@ public sealed class MechAssemblySystem : EntitySystem
{
[Dependency] private readonly ContainerSystem _container = default!;
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
/// <inheritdoc/>
public override void Initialize()
@@ -30,7 +32,7 @@ public sealed class MechAssemblySystem : EntitySystem
private void OnInteractUsing(EntityUid uid, MechAssemblyComponent component, InteractUsingEvent args)
{
if (TryComp<ToolComponent>(args.Used, out var toolComp) && toolComp.Qualities.Contains(component.QualityNeeded))
if (_toolSystem.HasQuality(args.Used, component.QualityNeeded))
{
foreach (var tag in component.RequiredParts.Keys)
{

View File

@@ -17,6 +17,7 @@ using Content.Shared.Tools.Components;
using Content.Shared.Verbs;
using Content.Shared.Wires;
using Content.Server.Body.Systems;
using Content.Shared.Tools.Systems;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
@@ -35,6 +36,7 @@ public sealed partial class MechSystem : SharedMechSystem
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
/// <inheritdoc/>
public override void Initialize()
@@ -87,7 +89,7 @@ public sealed partial class MechSystem : SharedMechSystem
return;
}
if (TryComp<ToolComponent>(args.Used, out var tool) && tool.Qualities.Contains("Prying") && component.BatterySlot.ContainedEntity != null)
if (_toolSystem.HasQuality(args.Used, "Prying") && component.BatterySlot.ContainedEntity != null)
{
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.BatteryRemovalDelay,
new RemoveBatteryEvent(), uid, target: uid, used: args.Target)