Extracts magic strings from Tag calls (#36305)

* Extracts magic strings from Tag calls

When #36281 gets merged, the `TagSystem` methods will all give warnings. Let's fix those warnings before they even happen!

* Adds missing libraries

* Remove not yet implemented TagSystem changes

* Fix tag spelling error

Genuinely surprised there was only 1!

* Styling and proper type changes

* Styling

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
This commit is contained in:
J
2025-04-05 00:20:19 +00:00
committed by GitHub
parent e58ab56e42
commit af9526197a
36 changed files with 156 additions and 51 deletions

View File

@@ -9,6 +9,7 @@ using Content.Shared.Projectiles;
using Content.Shared.Tag;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Collections;
using Robust.Shared.Prototypes;
namespace Content.Server.Chemistry.EntitySystems;
@@ -24,6 +25,8 @@ public sealed class SolutionInjectOnCollideSystem : EntitySystem
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly TagSystem _tag = default!;
private static readonly ProtoId<TagPrototype> HardsuitTag = "Hardsuit";
public override void Initialize()
{
base.Initialize();
@@ -93,7 +96,7 @@ public sealed class SolutionInjectOnCollideSystem : EntitySystem
// Yuck, this is way to hardcodey for my tastes
// TODO blocking injection with a hardsuit should probably done with a cancellable event or something
if (!injector.Comp.PierceArmor && _inventory.TryGetSlotEntity(target, "outerClothing", out var suit) && _tag.HasTag(suit.Value, "Hardsuit"))
if (!injector.Comp.PierceArmor && _inventory.TryGetSlotEntity(target, "outerClothing", out var suit) && _tag.HasTag(suit.Value, HardsuitTag))
{
// Only show popup to attacker
if (source != null)