]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Extracts magic strings from Tag calls (#36305)
authorJ <billsmith116@gmail.com>
Sat, 5 Apr 2025 00:20:19 +0000 (00:20 +0000)
committerGitHub <noreply@github.com>
Sat, 5 Apr 2025 00:20:19 +0000 (20:20 -0400)
* 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>
36 files changed:
Content.Client/Verbs/VerbSystem.cs
Content.IntegrationTests/Tests/Commands/SuicideCommandTests.cs
Content.Server/Botany/Systems/PlantHolderSystem.cs
Content.Server/Chat/SuicideSystem.cs
Content.Server/Chemistry/EntitySystems/SolutionInjectOnEventSystem.cs
Content.Server/Construction/Commands/FixRotationsCommand.cs
Content.Server/Electrocution/ElectrocutionSystem.cs
Content.Server/Flash/FlashSystem.cs
Content.Server/Forensics/Systems/ForensicScannerSystem.cs
Content.Server/GameTicking/Rules/SurvivorRuleSystem.cs
Content.Server/Ghost/GhostSystem.cs
Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs
Content.Server/Light/EntitySystems/ExpendableLightSystem.cs
Content.Server/Magic/MagicSystem.cs
Content.Server/MagicMirror/MagicMirrorSystem.cs
Content.Server/Nutrition/EntitySystems/TrashOnSolutionEmptySystem.cs
Content.Server/Payload/EntitySystems/PayloadSystem.cs
Content.Server/Procedural/DungeonJob/DungeonJob.PostGen.cs
Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs
Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs
Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs
Content.Server/Tools/Innate/InnateToolSystem.cs
Content.Server/Zombies/ZombieSystem.Transform.cs
Content.Shared/Clothing/EntitySystems/SharedChameleonClothingSystem.cs
Content.Shared/Construction/Conditions/NoWindowsInTile.cs
Content.Shared/Construction/Conditions/WallmountCondition.cs
Content.Shared/Delivery/SharedDeliverySystem.cs
Content.Shared/DoAfter/SharedDoAfterSystem.cs
Content.Shared/Follower/FollowerSystem.cs
Content.Shared/Hands/EntitySystems/SharedHandsSystem.Drop.cs
Content.Shared/Implants/SharedSubdermalImplantSystem.cs
Content.Shared/Interaction/SharedInteractionSystem.cs
Content.Shared/Magic/SharedMagicSystem.cs
Content.Shared/Movement/Systems/SharedMoverController.cs
Content.Shared/Paper/PaperSystem.cs
Content.Shared/RCD/Systems/RCDSystem.cs

index d6513c0a7809f2127879ca5b7503daa2d51344c6..92596f9dc0e978d78f3073558cf993b712c9253d 100644 (file)
@@ -16,6 +16,7 @@ using Robust.Client.State;
 using Robust.Shared.Configuration;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 
 namespace Content.Client.Verbs
@@ -36,6 +37,8 @@ namespace Content.Client.Verbs
 
         private float _lookupSize;
 
+        private static readonly ProtoId<TagPrototype> HideContextMenuTag = "HideContextMenu";
+
         /// <summary>
         ///     These flags determine what entities the user can see on the context menu.
         /// </summary>
@@ -147,7 +150,7 @@ namespace Content.Client.Verbs
 
             for (var i = entities.Count - 1; i >= 0; i--)
             {
-                if (_tagSystem.HasTag(entities[i], "HideContextMenu"))
+                if (_tagSystem.HasTag(entities[i], HideContextMenuTag))
                     entities.RemoveSwap(i);
             }
 
index cf88f3aacd304ae3514d2bc46ee970e8a4488115..94dd98425baf4662d0e03bed2d48ebbac2e97c6b 100644 (file)
@@ -1,4 +1,4 @@
-using System.Linq;
+using System.Linq;
 using Content.Shared.Damage;
 using Content.Shared.Damage.Prototypes;
 using Content.Shared.Execution;
@@ -52,7 +52,7 @@ public sealed class SuicideCommandTests
   name: test version of the material reclaimer
   components:
   - type: MaterialReclaimer";
-
+    private static readonly ProtoId<TagPrototype> CannotSuicideTag = "CannotSuicide";
     /// <summary>
     /// Run the suicide command in the console
     /// Should successfully kill the player and ghost them
@@ -201,7 +201,7 @@ public sealed class SuicideCommandTests
             mobStateComp = entManager.GetComponent<MobStateComponent>(player);
         });
 
-        tagSystem.AddTag(player, "CannotSuicide");
+        tagSystem.AddTag(player, CannotSuicideTag);
 
         // Check that running the suicide command kills the player
         // and properly ghosts them without them being able to return to their body
index 15cb82ef00c217e01c8ad09b0e23b9d3a11d71ba..5dbafae5afd43bc27bef1654cfd18f0e2ccff6c9 100644 (file)
@@ -50,6 +50,9 @@ public sealed class PlantHolderSystem : EntitySystem
     public const float HydroponicsSpeedMultiplier = 1f;
     public const float HydroponicsConsumptionMultiplier = 2f;
 
+    private static readonly ProtoId<TagPrototype> HoeTag = "Hoe";
+    private static readonly ProtoId<TagPrototype> PlantSampleTakerTag = "PlantSampleTaker";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -203,7 +206,7 @@ public sealed class PlantHolderSystem : EntitySystem
             return;
         }
 
-        if (_tagSystem.HasTag(args.Used, "Hoe"))
+        if (_tagSystem.HasTag(args.Used, HoeTag))
         {
             args.Handled = true;
             if (component.WeedLevel > 0)
@@ -243,7 +246,7 @@ public sealed class PlantHolderSystem : EntitySystem
             return;
         }
 
-        if (_tagSystem.HasTag(args.Used, "PlantSampleTaker"))
+        if (_tagSystem.HasTag(args.Used, PlantSampleTakerTag))
         {
             args.Handled = true;
             if (component.Seed == null)
index 497c9a1fe4341a75f64aa1b5b5f432bf8a7faf73..b9a3ede2bd7ef7157e8561f07aef8b0992c02144 100644 (file)
@@ -14,6 +14,7 @@ using Content.Shared.Mobs.Systems;
 using Content.Shared.Popups;
 using Content.Shared.Tag;
 using Robust.Shared.Player;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Chat;
 
@@ -27,6 +28,8 @@ public sealed class SuicideSystem : EntitySystem
     [Dependency] private readonly GhostSystem _ghostSystem = default!;
     [Dependency] private readonly SharedSuicideSystem _suicide = default!;
 
+    private static readonly ProtoId<TagPrototype> CannotSuicideTag = "CannotSuicide";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -60,7 +63,7 @@ public sealed class SuicideSystem : EntitySystem
 
         // Suicide is considered a fail if the user wasn't able to ghost
         // Suiciding with the CannotSuicide tag will ghost the player but not kill the body
-        if (!suicideGhostEvent.Handled || _tagSystem.HasTag(victim, "CannotSuicide"))
+        if (!suicideGhostEvent.Handled || _tagSystem.HasTag(victim, CannotSuicideTag))
             return false;
 
         var suicideEvent = new SuicideEvent(victim);
@@ -95,7 +98,7 @@ public sealed class SuicideSystem : EntitySystem
 
         // CannotSuicide tag will allow the user to ghost, but also return to their mind
         // This is kind of weird, not sure what it applies to?
-        if (_tagSystem.HasTag(victim, "CannotSuicide"))
+        if (_tagSystem.HasTag(victim, CannotSuicideTag))
             args.CanReturnToBody = true;
 
         if (_ghostSystem.OnGhostAttempt(victim.Comp.Mind.Value, args.CanReturnToBody, mind: mindComponent))
index f15edcf0672000fb35026eecdf00ce7c26e1cb84..503a0ebde6469739e76fc3b969ab5de249c58f29 100644 (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)
index 3232f12ed84a4dc70031be3cb67984b5de94c580..807f81b4987cc108805b93f2e81de69dd35bcaad 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Construction;
 using Content.Shared.Tag;
 using Robust.Shared.Console;
 using Robust.Shared.Map.Components;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Construction.Commands;
 
@@ -13,6 +14,10 @@ public sealed class FixRotationsCommand : IConsoleCommand
 {
     [Dependency] private readonly IEntityManager _entManager = default!;
 
+    private static readonly ProtoId<TagPrototype> ForceFixRotationsTag = "ForceFixRotations";
+    private static readonly ProtoId<TagPrototype> ForceNoFixRotationsTag = "ForceNoFixRotations";
+    private static readonly ProtoId<TagPrototype> DiagonalTag = "Diagonal";
+
     // ReSharper disable once StringLiteralTypo
     public string Command => "fixrotations";
     public string Description => "Sets the rotation of all occluders, low walls and windows to south.";
@@ -86,11 +91,11 @@ public sealed class FixRotationsCommand : IConsoleCommand
             // cables
             valid |= _entManager.HasComponent<CableComponent>(child);
             // anything else that might need this forced
-            valid |= tagSystem.HasTag(child, "ForceFixRotations");
+            valid |= tagSystem.HasTag(child, ForceFixRotationsTag);
             // override
-            valid &= !tagSystem.HasTag(child, "ForceNoFixRotations");
+            valid &= !tagSystem.HasTag(child, ForceNoFixRotationsTag);
             // remove diagonal entities as well
-            valid &= !tagSystem.HasTag(child, "Diagonal");
+            valid &= !tagSystem.HasTag(child, DiagonalTag);
 
             if (!valid)
                 continue;
index eb10f8d28092d954fcb8c71a3ca3217520251176..c7adb311d321cbed1ce998175d50a5395aa5bdbb 100644 (file)
@@ -62,6 +62,8 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
     [ValidatePrototypeId<DamageTypePrototype>]
     private const string DamageType = "Shock";
 
+    private static readonly ProtoId<TagPrototype> WindowTag = "Window";
+
     // Multiply and shift the log scale for shock damage.
     private const float RecursiveDamageMultiplier = 0.75f;
     private const float RecursiveTimeMultiplier = 0.8f;
@@ -139,7 +141,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
             {
                 foreach (var entity in _entityLookup.GetLocalEntitiesIntersecting(tileRef.Value, flags: LookupFlags.StaticSundries))
                 {
-                    if (_tag.HasTag(entity, "Window"))
+                    if (_tag.HasTag(entity, WindowTag))
                         return false;
                 }
             }
index fb449a372cd4996adce76559e35212b23ce2ef1a..60c09efaeab2d34f318b01445eb68244c17134e3 100644 (file)
@@ -21,6 +21,7 @@ using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Random;
 using InventoryComponent = Content.Shared.Inventory.InventoryComponent;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Flash
 {
@@ -39,6 +40,8 @@ namespace Content.Server.Flash
         [Dependency] private readonly IRobustRandom _random = default!;
         [Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
 
+        private static readonly ProtoId<TagPrototype> TrashTag = "Trash";
+
         public override void Initialize()
         {
             base.Initialize();
@@ -94,7 +97,7 @@ namespace Content.Server.Flash
             if (_charges.IsEmpty(uid, charges))
             {
                 _appearance.SetData(uid, FlashVisuals.Burnt, true);
-                _tag.AddTag(uid, "Trash");
+                _tag.AddTag(uid, TrashTag);
                 _popup.PopupEntity(Loc.GetString("flash-component-becomes-empty"), user);
             }
 
index 984334ee8eece7d94f351d8b1738c2a33c6641bb..f0eb12c34d5b23ec390346d74039e33087207f57 100644 (file)
@@ -16,6 +16,7 @@ using Robust.Shared.Audio;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
 using Content.Server.Chemistry.Containers.EntitySystems;
+using Robust.Shared.Prototypes;
 // todo: remove this stinky LINQy
 
 namespace Content.Server.Forensics
@@ -33,6 +34,8 @@ namespace Content.Server.Forensics
         [Dependency] private readonly ForensicsSystem _forensicsSystem = default!;
         [Dependency] private readonly TagSystem _tag = default!;
 
+        private static readonly ProtoId<TagPrototype> DNASolutionScannableTag = "DNASolutionScannable";
+
         public override void Initialize()
         {
             base.Initialize();
@@ -86,7 +89,7 @@ namespace Content.Server.Forensics
                     scanner.Residues = forensics.Residues.ToList();
                 }
 
-                if (_tag.HasTag(args.Args.Target.Value, "DNASolutionScannable"))
+                if (_tag.HasTag(args.Args.Target.Value, DNASolutionScannableTag))
                 {
                     scanner.SolutionDNAs = _forensicsSystem.GetSolutionsDNA(args.Args.Target.Value);
                 } else
index 81ad2b1be7933f73aa2256f30e4581aa4da8db8c..4990b98b9170d2c2b7f929f629d07ed989e77a0a 100644 (file)
@@ -9,6 +9,7 @@ using Content.Shared.Mobs.Systems;
 using Content.Shared.Survivor.Components;
 using Content.Shared.Tag;
 using Robust.Server.GameObjects;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.GameTicking.Rules;
 
@@ -22,6 +23,8 @@ public sealed class SurvivorRuleSystem : GameRuleSystem<SurvivorRuleComponent>
     [Dependency] private readonly TagSystem _tag = default!;
     [Dependency] private readonly MobStateSystem _mobState = default!;
 
+    private static readonly ProtoId<TagPrototype> InvalidForSurvivorAntagTag = "InvalidForSurvivorAntag";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -44,7 +47,7 @@ public sealed class SurvivorRuleSystem : GameRuleSystem<SurvivorRuleComponent>
             var mind = humanMind.Owner;
             var ent = humanMind.Comp.OwnedEntity.Value;
 
-            if (HasComp<SurvivorComponent>(mind) || _tag.HasTag(mind, "InvalidForSurvivorAntag"))
+            if (HasComp<SurvivorComponent>(mind) || _tag.HasTag(mind, InvalidForSurvivorAntagTag))
                 continue;
 
             EnsureComp<SurvivorComponent>(mind);
index e7125ee4f24d11f58f837c19ccf917b20f2646bb..435584e908350355ead3ef4ac7f95026ee7f4eb8 100644 (file)
@@ -72,6 +72,8 @@ namespace Content.Server.Ghost
         private EntityQuery<GhostComponent> _ghostQuery;
         private EntityQuery<PhysicsComponent> _physicsQuery;
 
+        private static readonly ProtoId<TagPrototype> AllowGhostShownByEventTag = "AllowGhostShownByEvent";
+
         public override void Initialize()
         {
             base.Initialize();
@@ -403,7 +405,7 @@ namespace Content.Server.Ghost
             var entityQuery = EntityQueryEnumerator<GhostComponent, VisibilityComponent>();
             while (entityQuery.MoveNext(out var uid, out var _, out var vis))
             {
-                if (!_tag.HasTag(uid, "AllowGhostShownByEvent"))
+                if (!_tag.HasTag(uid, AllowGhostShownByEventTag))
                     continue;
 
                 if (visible)
index 7f0778cbdd939d67599b00a6979f6d8e4103545b..4f71cc4721b0487d025e9cadf52442a89a973c34 100644 (file)
@@ -73,6 +73,9 @@ namespace Content.Server.Kitchen.EntitySystems
         [ValidatePrototypeId<EntityPrototype>]
         private const string MalfunctionSpark = "Spark";
 
+        private static readonly ProtoId<TagPrototype> MetalTag = "Metal";
+        private static readonly ProtoId<TagPrototype> PlasticTag = "Plastic";
+
         public override void Initialize()
         {
             base.Initialize();
@@ -550,12 +553,12 @@ namespace Content.Server.Kitchen.EntitySystems
                     return;
                 }
 
-                if (_tag.HasTag(item, "Metal"))
+                if (_tag.HasTag(item, MetalTag))
                 {
                     malfunctioning = true;
                 }
 
-                if (_tag.HasTag(item, "Plastic"))
+                if (_tag.HasTag(item, PlasticTag))
                 {
                     var junk = Spawn(component.BadRecipeEntityId, Transform(uid).Coordinates);
                     _container.Insert(junk, component.Storage);
index b56da84f03023656325a271cc79eec45d96bf9f4..7aacf3e7ad1ee31e8ccb786110578e054b8cf015 100644 (file)
@@ -10,6 +10,7 @@ using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio.Systems;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Light.EntitySystems
@@ -24,6 +25,8 @@ namespace Content.Server.Light.EntitySystems
         [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
         [Dependency] private readonly MetaDataSystem _metaData = default!;
 
+        private static readonly ProtoId<TagPrototype> TrashTag = "Trash";
+
         public override void Initialize()
         {
             base.Initialize();
@@ -69,7 +72,7 @@ namespace Content.Server.Light.EntitySystems
                         _metaData.SetEntityName(ent, Loc.GetString(component.SpentName), meta);
                         _metaData.SetEntityDescription(ent, Loc.GetString(component.SpentDesc), meta);
 
-                        _tagSystem.AddTag(ent, "Trash");
+                        _tagSystem.AddTag(ent, TrashTag);
 
                         UpdateSounds(ent);
                         UpdateVisualizer(ent);
index 34c12954c69e9c8feb081f4cbbc0181a4d4c63d2..dafd88dd5f0b959e5c38f960bc2923578084a550 100644 (file)
@@ -16,6 +16,8 @@ public sealed class MagicSystem : SharedMagicSystem
     [Dependency] private readonly TagSystem _tag = default!;
     [Dependency] private readonly SharedMindSystem _mind = default!;
 
+    private static readonly ProtoId<TagPrototype> InvalidForSurvivorAntagTag = "InvalidForSurvivorAntag";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -48,8 +50,8 @@ public sealed class MagicSystem : SharedMagicSystem
         if (!ev.MakeSurvivorAntagonist)
             return;
 
-        if (_mind.TryGetMind(ev.Performer, out var mind, out _) && !_tag.HasTag(mind, "InvalidForSurvivorAntag"))
-            _tag.AddTag(mind, "InvalidForSurvivorAntag");
+        if (_mind.TryGetMind(ev.Performer, out var mind, out _) && !_tag.HasTag(mind, InvalidForSurvivorAntagTag))
+            _tag.AddTag(mind, InvalidForSurvivorAntagTag);
 
         EntProtoId survivorRule = "Survivor";
 
index f3be03b4b0d6cdcec23253b226cd94e10252a9f1..37302999ed7216626dcf37976191e8b967250f70 100644 (file)
@@ -11,6 +11,7 @@ using Content.Shared.MagicMirror;
 using Content.Shared.Popups;
 using Content.Shared.Tag;
 using Robust.Shared.Audio.Systems;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.MagicMirror;
 
@@ -27,6 +28,8 @@ public sealed class MagicMirrorSystem : SharedMagicMirrorSystem
     [Dependency] private readonly InventorySystem _inventory = default!;
     [Dependency] private readonly TagSystem _tagSystem = default!;
 
+    private static readonly ProtoId<TagPrototype> HidesHairTag = "HidesHair";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -391,7 +394,7 @@ public sealed class MagicMirrorSystem : SharedMagicMirrorSystem
             var slots = _inventory.GetSlotEnumerator((target, inventoryComp), SlotFlags.WITHOUT_POCKET);
             while (slots.MoveNext(out var slot))
             {
-                if (slot.ContainedEntity != null && _tagSystem.HasTag(slot.ContainedEntity.Value, "HidesHair"))
+                if (slot.ContainedEntity != null && _tagSystem.HasTag(slot.ContainedEntity.Value, HidesHairTag))
                 {
                     return true;
                 }
index b2e12036f9e4b9ee3fcd378f95bb820656d51959..ea3a8be9cbd3c85589b2254a1b330df6de2bc310 100644 (file)
@@ -3,6 +3,7 @@ using Content.Shared.Chemistry.Components;
 using Content.Shared.Chemistry.Components.SolutionManager;
 using Content.Shared.Chemistry.EntitySystems;
 using Content.Shared.Tag;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Nutrition.EntitySystems
 {
@@ -11,6 +12,8 @@ namespace Content.Server.Nutrition.EntitySystems
         [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
         [Dependency] private readonly TagSystem _tagSystem = default!;
 
+        private static readonly ProtoId<TagPrototype> TrashTag = "Trash";
+
         public override void Initialize()
         {
             base.Initialize();
@@ -41,11 +44,11 @@ namespace Content.Server.Nutrition.EntitySystems
         {
             if (solution.Volume <= 0)
             {
-                _tagSystem.AddTag(entity.Owner, "Trash");
+                _tagSystem.AddTag(entity.Owner, TrashTag);
                 return;
             }
-            if (_tagSystem.HasTag(entity.Owner, "Trash"))
-                _tagSystem.RemoveTag(entity.Owner, "Trash");
+
+            _tagSystem.RemoveTag(entity.Owner, TrashTag);
         }
     }
 }
index f5159bf223a38f18111795ce337a1615d089b2ba..bf562f747f98aaf5ea598f8ecb8de729d59b912a 100644 (file)
@@ -11,6 +11,7 @@ using Robust.Shared.Serialization.Manager;
 using Robust.Shared.Utility;
 using System.Linq;
 using Robust.Server.GameObjects;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Payload.EntitySystems;
 
@@ -23,6 +24,8 @@ public sealed class PayloadSystem : EntitySystem
     [Dependency] private readonly IComponentFactory _componentFactory = default!;
     [Dependency] private readonly ISerializationManager _serializationManager = default!;
 
+    private static readonly ProtoId<TagPrototype> PayloadTag = "Payload";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -44,7 +47,7 @@ public sealed class PayloadSystem : EntitySystem
         {
             foreach (var entity in container.ContainedEntities)
             {
-                if (_tagSystem.HasTag(entity, "Payload"))
+                if (_tagSystem.HasTag(entity, PayloadTag))
                     yield return entity;
             }
         }
@@ -71,7 +74,7 @@ public sealed class PayloadSystem : EntitySystem
             return;
 
         // Ensure we don't enter a trigger-loop
-        DebugTools.Assert(!_tagSystem.HasTag(uid, "Payload"));
+        DebugTools.Assert(!_tagSystem.HasTag(uid, PayloadTag));
 
         RaiseLocalEvent(parent, args, false);
     }
index b1c83346d872808070377b848ecbbf81be4968d7..84e7563f338ea9aa4d221ad97ffda2b9010ec440 100644 (file)
@@ -1,8 +1,10 @@
 using System.Numerics;
 using Content.Shared.Procedural;
+using Content.Shared.Tag;
 using Robust.Shared.Collections;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Physics.Components;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Procedural.DungeonJob;
 
@@ -12,13 +14,15 @@ public sealed partial class DungeonJob
      * Run after the main dungeon generation
      */
 
+    private static readonly ProtoId<TagPrototype> WallTag = "Wall";
+
     private bool HasWall(Vector2i tile)
     {
         var anchored = _maps.GetAnchoredEntitiesEnumerator(_gridUid, _grid, tile);
 
         while (anchored.MoveNext(out var uid))
         {
-            if (_tags.HasTag(uid.Value, "Wall"))
+            if (_tags.HasTag(uid.Value, WallTag))
                 return true;
         }
 
index 1eb9aabed6a1f4e7aaa940ae6ee3047e31b800ee..51cbb6d4d571349e1facb3668e097edd262a49d2 100644 (file)
@@ -29,6 +29,7 @@ using Robust.Shared.Physics.Components;
 using Robust.Shared.Utility;
 using Robust.Shared.Map.Components;
 using Content.Shared.Whitelist;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Revenant.EntitySystems;
 
@@ -44,6 +45,8 @@ public sealed partial class RevenantSystem
     [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
     [Dependency] private readonly SharedMapSystem _mapSystem = default!;
 
+    private static readonly ProtoId<TagPrototype> WindowTag = "Window";
+
     private void InitializeAbilities()
     {
         SubscribeLocalEvent<RevenantComponent, UserActivateInWorldEvent>(OnInteract);
@@ -253,7 +256,7 @@ public sealed partial class RevenantSystem
         foreach (var ent in lookup)
         {
             //break windows
-            if (tags.HasComponent(ent) && _tag.HasTag(ent, "Window"))
+            if (tags.HasComponent(ent) && _tag.HasTag(ent, WindowTag))
             {
                 //hardcoded damage specifiers til i die.
                 var dspec = new DamageSpecifier();
index f02ea945d05df668533932ed3b014c7c61331632..478b002e58538628b1c4db5fe4907d0f730c5add 100644 (file)
@@ -21,6 +21,7 @@ using Robust.Shared.GameStates;
 using Robust.Shared.Map;
 using Robust.Shared.Utility;
 using Content.Shared.UserInterface;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Shuttles.Systems;
 
@@ -43,6 +44,8 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
 
     private readonly HashSet<Entity<ShuttleConsoleComponent>> _consoles = new();
 
+    private static readonly ProtoId<TagPrototype> CanPilotTag = "CanPilot";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -168,7 +171,7 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
 
     private bool TryPilot(EntityUid user, EntityUid uid)
     {
-        if (!_tags.HasTag(user, "CanPilot") ||
+        if (!_tags.HasTag(user, CanPilotTag) ||
             !TryComp<ShuttleConsoleComponent>(uid, out var component) ||
             !this.IsPowered(uid, EntityManager) ||
             !Transform(uid).Anchored ||
index 729328b8bd7958673de2a4ba2cad3214aece2039..68543cc175587c98799580ab226f1594ce4189d8 100644 (file)
@@ -14,6 +14,7 @@ using Robust.Shared.Map.Components;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Physics.Systems;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Singularity.EntitySystems;
@@ -36,6 +37,8 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
     [Dependency] private readonly TagSystem _tagSystem = default!;
     #endregion Dependencies
 
+    private static readonly ProtoId<TagPrototype> HighRiskItemTag = "HighRiskItem";
+
     private EntityQuery<PhysicsComponent> _physicsQuery;
 
     public override void Initialize()
@@ -127,7 +130,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
             return;
 
         if (HasComp<MindContainerComponent>(morsel)
-            || _tagSystem.HasTag(morsel, "HighRiskItem")
+            || _tagSystem.HasTag(morsel, HighRiskItemTag)
             || HasComp<ContainmentFieldGeneratorComponent>(morsel))
         {
             _adminLogger.Add(LogType.EntityDelete, LogImpact.High, $"{ToPrettyString(morsel):player} entered the event horizon of {ToPrettyString(hungry)} and was deleted");
index e7e5be38c446ee97feac3d4f94d96966ac89a2d6..b8d1dd935cceb944012dda4701025262a75a00e4 100644 (file)
@@ -8,6 +8,7 @@ using Content.Shared.Interaction.Components;
 using Content.Shared.Storage;
 using Content.Shared.Tag;
 using Robust.Shared.Network;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 
 namespace Content.Server.Tools.Innate;
@@ -22,6 +23,8 @@ public sealed class InnateToolSystem : EntitySystem
     [Dependency] private readonly SharedHandsSystem _sharedHandsSystem = default!;
     [Dependency] private readonly TagSystem _tagSystem = default!;
 
+    private static readonly ProtoId<TagPrototype> InnateDontDeleteTag = "InnateDontDelete";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -76,7 +79,7 @@ public sealed class InnateToolSystem : EntitySystem
     {
         foreach (var tool in component.ToolUids)
         {
-            if (_tagSystem.HasTag(tool, "InnateDontDelete"))
+            if (_tagSystem.HasTag(tool, InnateDontDeleteTag))
             {
                 RemComp<UnremoveableComponent>(tool);
             }
index 47d94984c04c43048656de95f7f41f705fc0aaa1..155796481b690a478aa431a5d92867dcc27d9e05 100644 (file)
@@ -36,6 +36,7 @@ using Content.Shared.Traits.Assorted;
 using Robust.Shared.Audio.Systems;
 using Content.Shared.Ghost.Roles.Components;
 using Content.Shared.Tag;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Zombies;
 
@@ -61,6 +62,8 @@ public sealed partial class ZombieSystem
     [Dependency] private readonly TagSystem _tag = default!;
     [Dependency] private readonly NameModifierSystem _nameMod = default!;
 
+    private static readonly ProtoId<TagPrototype> InvalidForGlobalSpawnSpellTag = "InvalidForGlobalSpawnSpell";
+
     /// <summary>
     /// Handles an entity turning into a zombie when they die or go into crit
     /// </summary>
@@ -290,6 +293,6 @@ public sealed partial class ZombieSystem
 
         //Need to prevent them from getting an item, they have no hands.
         // Also prevents them from becoming a Survivor. They're undead.
-        _tag.AddTag(target, "InvalidForGlobalSpawnSpell");
+        _tag.AddTag(target, InvalidForGlobalSpawnSpellTag);
     }
 }
index 725b0347661e21665520fa449bc23b0f322155e4..f996c65fe821aef99d582ad26a8e7cfe5f81b212 100644 (file)
@@ -23,6 +23,8 @@ public abstract class SharedChameleonClothingSystem : EntitySystem
     [Dependency] private readonly TagSystem _tag = default!;
     [Dependency] protected readonly SharedUserInterfaceSystem UI = default!;
 
+    private static readonly ProtoId<TagPrototype> WhitelistChameleonTag = "WhitelistChameleon";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -124,7 +126,7 @@ public abstract class SharedChameleonClothingSystem : EntitySystem
             return false;
 
         // check if it is marked as valid chameleon target
-        if (!proto.TryGetComponent(out TagComponent? tag, _factory) || !_tag.HasTag(tag, "WhitelistChameleon"))
+        if (!proto.TryGetComponent(out TagComponent? tag, _factory) || !_tag.HasTag(tag, WhitelistChameleonTag))
             return false;
 
         if (requiredTag != null && !_tag.HasTag(tag, requiredTag))
index 3ae3b59362788bedf365603a01b28a15ec404e5c..2d37ecebe64925ca27e430fb26babd6aa02a64db 100644 (file)
@@ -1,7 +1,8 @@
-using Content.Shared.Maps;
+using Content.Shared.Maps;
 using Content.Shared.Tag;
 using JetBrains.Annotations;
 using Robust.Shared.Map;
+using Robust.Shared.Prototypes;
 
 namespace Content.Shared.Construction.Conditions
 {
@@ -9,6 +10,8 @@ namespace Content.Shared.Construction.Conditions
     [DataDefinition]
     public sealed partial class NoWindowsInTile : IConstructionCondition
     {
+        private static readonly ProtoId<TagPrototype> WindowTag = "Window";
+
         public bool Condition(EntityUid user, EntityCoordinates location, Direction direction)
         {
             var entManager = IoCManager.Resolve<IEntityManager>();
@@ -17,7 +20,7 @@ namespace Content.Shared.Construction.Conditions
 
             foreach (var entity in location.GetEntitiesInTile(LookupFlags.Static))
             {
-                if (tagSystem.HasTag(entity, "Window"))
+                if (tagSystem.HasTag(entity, WindowTag))
                     return false;
             }
 
index f1d056165e4774c0e637378e8bd4952c76bfc41e..f32cc19eeaef8cb9d15c26d1737ba493621a6bad 100644 (file)
@@ -6,6 +6,7 @@ using JetBrains.Annotations;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Systems;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 
 namespace Content.Shared.Construction.Conditions
@@ -14,6 +15,8 @@ namespace Content.Shared.Construction.Conditions
     [DataDefinition]
     public sealed partial class WallmountCondition : IConstructionCondition
     {
+        private static readonly ProtoId<TagPrototype> WallTag = "Wall";
+
         public bool Condition(EntityUid user, EntityCoordinates location, Direction direction)
         {
             var entManager = IoCManager.Resolve<IEntityManager>();
@@ -42,7 +45,7 @@ namespace Content.Shared.Construction.Conditions
             var tagSystem = entManager.System<TagSystem>();
 
             var userToObjRaycastResults = physics.IntersectRayWithPredicate(entManager.GetComponent<TransformComponent>(user).MapID, rUserToObj, maxLength: length,
-                predicate: (e) => !tagSystem.HasTag(e, "Wall"));
+                predicate: (e) => !tagSystem.HasTag(e, WallTag));
 
             var targetWall = userToObjRaycastResults.FirstOrNull();
 
@@ -53,7 +56,7 @@ namespace Content.Shared.Construction.Conditions
             // check that we didn't try to build wallmount that facing another adjacent wall
             var rAdjWall = new CollisionRay(objWorldPosition, directionWithOffset.Normalized(), (int) CollisionGroup.Impassable);
             var adjWallRaycastResults = physics.IntersectRayWithPredicate(entManager.GetComponent<TransformComponent>(user).MapID, rAdjWall, maxLength: 0.5f,
-               predicate: e => e == targetWall.Value.HitEntity || !tagSystem.HasTag(e, "Wall"));
+               predicate: e => e == targetWall.Value.HitEntity || !tagSystem.HasTag(e, WallTag));
 
             return !adjWallRaycastResults.Any();
         }
index 52c9db40a1fc0b426f0395645b81aaec6ba48453..319bf41fce4d7d63ce649fd48259a3707fc74fe3 100644 (file)
@@ -12,6 +12,7 @@ using Content.Shared.Tag;
 using Content.Shared.Verbs;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
+using Robust.Shared.Prototypes;
 
 namespace Content.Shared.Delivery;
 
@@ -30,6 +31,9 @@ public abstract class SharedDeliverySystem : EntitySystem
     [Dependency] private readonly SharedHandsSystem _hands = default!;
     [Dependency] private readonly NameModifierSystem _nameModifier = default!;
 
+    private static readonly ProtoId<TagPrototype> TrashTag = "Trash";
+    private static readonly ProtoId<TagPrototype> RecyclableTag = "Recyclable";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -129,7 +133,7 @@ public abstract class SharedDeliverySystem : EntitySystem
         ent.Comp.IsOpened = true;
         _appearance.SetData(ent, DeliveryVisuals.IsTrash, ent.Comp.IsOpened);
 
-        _tag.AddTags(ent, "Trash", "Recyclable");
+        _tag.AddTags(ent, TrashTag, RecyclableTag);
         EnsureComp<SpaceGarbageComponent>(ent);
         RemComp<StealTargetComponent>(ent); // opened mail should not count for the objective
 
index c246c2844a4beba96d8a38b69cfd631fd11b220b..9765bac912ee814b471dec42c6355acb4e899bf9 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Damage;
 using Content.Shared.Hands.Components;
 using Content.Shared.Tag;
 using Robust.Shared.GameStates;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
@@ -23,6 +24,8 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
     /// </summary>
     private static readonly TimeSpan ExcessTime = TimeSpan.FromSeconds(0.5f);
 
+    private static readonly ProtoId<TagPrototype> InstantDoAftersTag = "InstantDoAfters";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -233,7 +236,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
 
         // TODO DO AFTER
         // Why does this tag exist? Just make this a bool on the component?
-        if (args.Delay <= TimeSpan.Zero || _tag.HasTag(args.User, "InstantDoAfters"))
+        if (args.Delay <= TimeSpan.Zero || _tag.HasTag(args.User, InstantDoAftersTag))
         {
             RaiseDoAfterEvents(doAfter, comp);
             // We don't store instant do-afters. This is just a lazy way of hiding them from client-side visuals.
index 243886dbb72f9d2fe01bf9bc7f2bdc3d28445c5f..75310a6737906bbf6a714d1ef2f101688f701d80 100644 (file)
@@ -18,6 +18,7 @@ using Robust.Shared.Network;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Player;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 
 namespace Content.Shared.Follower;
@@ -32,6 +33,8 @@ public sealed class FollowerSystem : EntitySystem
     [Dependency] private readonly INetManager _netMan = default!;
     [Dependency] private readonly ISharedAdminManager _adminManager = default!;
 
+    private static readonly ProtoId<TagPrototype> ForceableFollowTag = "ForceableFollow";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -106,7 +109,7 @@ public sealed class FollowerSystem : EntitySystem
             ev.Verbs.Add(verb);
         }
 
-        if (_tagSystem.HasTag(ev.Target, "ForceableFollow"))
+        if (_tagSystem.HasTag(ev.Target, ForceableFollowTag))
         {
             if (!ev.CanAccess || !ev.CanInteract)
                 return;
index 223c2d4a3783bb74ae0833f0220515fe82dc68a4..95773697db20666f6e01ec76425389278e70c9c5 100644 (file)
@@ -6,12 +6,16 @@ using Content.Shared.Inventory.VirtualItem;
 using Content.Shared.Tag;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
+using Robust.Shared.Prototypes;
 
 namespace Content.Shared.Hands.EntitySystems;
 
 public abstract partial class SharedHandsSystem
 {
     [Dependency] private readonly TagSystem _tagSystem = default!;
+
+    private static readonly ProtoId<TagPrototype> BypassDropChecksTag = "BypassDropChecks";
+
     private void InitializeDrop()
     {
         SubscribeLocalEvent<HandsComponent, EntRemovedFromContainerMessage>(HandleEntityRemoved);
@@ -37,7 +41,7 @@ public abstract partial class SharedHandsSystem
     private bool ShouldIgnoreRestrictions(EntityUid user)
     {
         //Checks if the Entity is something that shouldn't care about drop distance or walls ie Aghost
-        return !_tagSystem.HasTag(user, "BypassDropChecks");
+        return !_tagSystem.HasTag(user, BypassDropChecksTag);
     }
 
     /// <summary>
index bb166b3c5cb8c5b2c7894ee25d9766c872c3e325..e23357448f1c6d3f444c633539b7c4844fedb30f 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Tag;
 using JetBrains.Annotations;
 using Robust.Shared.Containers;
 using Robust.Shared.Network;
+using Robust.Shared.Prototypes;
 using System.Linq;
 
 namespace Content.Shared.Implants;
@@ -21,6 +22,9 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
 
     public const string BaseStorageId = "storagebase";
 
+    private static readonly ProtoId<TagPrototype> MicroBombTag = "MicroBomb";
+    private static readonly ProtoId<TagPrototype> MacroBombTag = "MacroBomb";
+
     public override void Initialize()
     {
         SubscribeLocalEvent<SubdermalImplantComponent, EntGotInsertedIntoContainerMessage>(OnInsert);
@@ -43,11 +47,11 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
         }
 
         //replace micro bomb with macro bomb
-        if (_container.TryGetContainer(component.ImplantedEntity.Value, ImplanterComponent.ImplantSlotId, out var implantContainer) && _tag.HasTag(uid, "MacroBomb"))
+        if (_container.TryGetContainer(component.ImplantedEntity.Value, ImplanterComponent.ImplantSlotId, out var implantContainer) && _tag.HasTag(uid, MacroBombTag))
         {
             foreach (var implant in implantContainer.ContainedEntities)
             {
-                if (_tag.HasTag(implant, "MicroBomb"))
+                if (_tag.HasTag(implant, MicroBombTag))
                 {
                     _container.Remove(implant, implantContainer);
                     QueueDel(implant);
index 2f09f3e54914cd946ec2c56c2cd3dc8cd8207d12..ff9f41e1f9d7993de20b18298cd0702c3980b238 100644 (file)
@@ -37,6 +37,7 @@ using Robust.Shared.Physics;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Player;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
@@ -87,6 +88,8 @@ namespace Content.Shared.Interaction
         public const float MaxRaycastRange = 100f;
         public const string RateLimitKey = "Interaction";
 
+        private static readonly ProtoId<TagPrototype> BypassInteractionRangeChecksTag = "BypassInteractionRangeChecks";
+
         public delegate bool Ignored(EntityUid entity);
 
         public override void Initialize()
@@ -318,7 +321,7 @@ namespace Content.Shared.Interaction
         {
             // This is for Admin/mapping convenience. If ever there are other ghosts that can still interact, this check
             // might need to be more selective.
-            return !_tagSystem.HasTag(user, "BypassInteractionRangeChecks");
+            return !_tagSystem.HasTag(user, BypassInteractionRangeChecksTag);
         }
 
         /// <summary>
index b502ff2fbb8338c9daa95381af086a0bdbf6b4ad..9a44407e9120efdf363cd3038efe3e4b2b06cd37 100644 (file)
@@ -65,6 +65,8 @@ public abstract class SharedMagicSystem : EntitySystem
     [Dependency] private readonly SharedMindSystem _mind = default!;
     [Dependency] private readonly SharedStunSystem _stun = default!;
 
+    private static readonly ProtoId<TagPrototype> InvalidForGlobalSpawnSpellTag = "InvalidForGlobalSpawnSpell";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -484,7 +486,7 @@ public abstract class SharedMagicSystem : EntitySystem
 
             var ent = human.Comp.OwnedEntity.Value;
 
-            if (_tag.HasTag(ent, "InvalidForGlobalSpawnSpell"))
+            if (_tag.HasTag(ent, InvalidForGlobalSpawnSpellTag))
                 continue;
 
             var mapCoords = _transform.GetMapCoordinates(ent);
index 76e2f3436888c50fc6cd3c2379c757eba9bd4a17..a5c32b2992defaa0ef2c9fc4cf460e1fb01080d5 100644 (file)
@@ -20,6 +20,7 @@ using Robust.Shared.Physics;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Controllers;
 using Robust.Shared.Physics.Systems;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
 using PullableComponent = Content.Shared.Movement.Pulling.Components.PullableComponent;
@@ -59,6 +60,8 @@ public abstract partial class SharedMoverController : VirtualController
     protected EntityQuery<FootstepModifierComponent> FootstepModifierQuery;
     protected EntityQuery<MapGridComponent> MapGridQuery;
 
+    private static readonly ProtoId<TagPrototype> FootstepSoundTag = "FootstepSound";
+
     /// <summary>
     /// <see cref="CCVars.StopSpeed"/>
     /// </summary>
@@ -431,7 +434,7 @@ public abstract partial class SharedMoverController : VirtualController
     {
         sound = null;
 
-        if (!CanSound() || !_tags.HasTag(uid, "FootstepSound"))
+        if (!CanSound() || !_tags.HasTag(uid, FootstepSoundTag))
             return false;
 
         var coordinates = xform.Coordinates;
index 712133c0e6456fb4124c8500217959067512aa6e..6fda16b1f37dfc2051e106c56fcb7ea22bce3c86 100644 (file)
@@ -9,6 +9,7 @@ using Content.Shared.Tag;
 using Robust.Shared.Player;
 using Robust.Shared.Audio.Systems;
 using static Content.Shared.Paper.PaperComponent;
+using Robust.Shared.Prototypes;
 
 namespace Content.Shared.Paper;
 
@@ -23,6 +24,9 @@ public sealed class PaperSystem : EntitySystem
     [Dependency] private readonly MetaDataSystem _metaSystem = default!;
     [Dependency] private readonly SharedAudioSystem _audio = default!;
 
+    private static readonly ProtoId<TagPrototype> WriteIgnoreStampsTag = "WriteIgnoreStamps";
+    private static readonly ProtoId<TagPrototype> WriteTag = "Write";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -100,8 +104,8 @@ public sealed class PaperSystem : EntitySystem
     private void OnInteractUsing(Entity<PaperComponent> entity, ref InteractUsingEvent args)
     {
         // only allow editing if there are no stamps or when using a cyberpen
-        var editable = entity.Comp.StampedBy.Count == 0 || _tagSystem.HasTag(args.Used, "WriteIgnoreStamps");
-        if (_tagSystem.HasTag(args.Used, "Write"))
+        var editable = entity.Comp.StampedBy.Count == 0 || _tagSystem.HasTag(args.Used, WriteIgnoreStampsTag);
+        if (_tagSystem.HasTag(args.Used, WriteTag))
         {
             if (editable)
             {
index 62ad2f3be0dec8a89dbeb15db40a83dd0526f89b..9e5096c77c6cb0cd90a79f5348438b0375e1e07e 100644 (file)
@@ -51,6 +51,7 @@ public class RCDSystem : EntitySystem
     private readonly EntProtoId _instantConstructionFx = "EffectRCDConstruct0";
     private readonly ProtoId<RCDPrototype> _deconstructTileProto = "DeconstructTile";
     private readonly ProtoId<RCDPrototype> _deconstructLatticeProto = "DeconstructLattice";
+    private static readonly ProtoId<TagPrototype> CatwalkTag = "Catwalk";
 
     private HashSet<EntityUid> _intersectingEntities = new();
 
@@ -411,7 +412,7 @@ public class RCDSystem : EntitySystem
             if (isWindow && HasComp<SharedCanBuildWindowOnTopComponent>(ent))
                 continue;
 
-            if (isCatwalk && _tags.HasTag(ent, "Catwalk"))
+            if (isCatwalk && _tags.HasTag(ent, CatwalkTag))
             {
                 if (popMsgs)
                     _popup.PopupClient(Loc.GetString("rcd-component-cannot-build-on-occupied-tile-message"), uid, user);