Forbid string literals for SharedToolSystem methods (#38250)

* Forbid string literals for ToolSystem methods

* Cleanup violations

* Sort usings
This commit is contained in:
Tayrtahn
2025-06-10 21:58:21 -04:00
committed by GitHub
parent 58606ca230
commit d612c56aab
5 changed files with 44 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
using System.Linq;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Body.Systems;
using Content.Server.Mech.Components;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
@@ -13,16 +14,17 @@ using Content.Shared.Mech.Components;
using Content.Shared.Mech.EntitySystems;
using Content.Shared.Movement.Events;
using Content.Shared.Popups;
using Content.Shared.Tools;
using Content.Shared.Tools.Components;
using Content.Shared.Verbs;
using Content.Shared.Wires;
using Content.Server.Body.Systems;
using Content.Shared.Tools.Systems;
using Content.Shared.Verbs;
using Content.Shared.Whitelist;
using Content.Shared.Wires;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Content.Shared.Whitelist;
using Robust.Shared.Prototypes;
namespace Content.Server.Mech.Systems;
@@ -40,6 +42,8 @@ public sealed partial class MechSystem : SharedMechSystem
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
private static readonly ProtoId<ToolQualityPrototype> PryingQuality = "Prying";
/// <inheritdoc/>
public override void Initialize()
{
@@ -91,7 +95,7 @@ public sealed partial class MechSystem : SharedMechSystem
return;
}
if (_toolSystem.HasQuality(args.Used, "Prying") && component.BatterySlot.ContainedEntity != null)
if (_toolSystem.HasQuality(args.Used, PryingQuality) && component.BatterySlot.ContainedEntity != null)
{
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.BatteryRemovalDelay,
new RemoveBatteryEvent(), uid, target: uid, used: args.Target)