Forbid string literals for NpcFactionSystem methods (#38140)

* Add ForbidLiteral attribute to NpcFactionSystem methods

* Cleanup resulting warnings
This commit is contained in:
Tayrtahn
2025-06-07 18:39:18 -04:00
committed by GitHub
parent c5bdbdfea9
commit e909ffa933
4 changed files with 33 additions and 22 deletions

View File

@@ -38,6 +38,7 @@ using Content.Shared.Ghost.Roles.Components;
using Content.Shared.Tag;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Content.Shared.NPC.Prototypes;
namespace Content.Server.Zombies;
@@ -66,6 +67,8 @@ public sealed partial class ZombieSystem
private static readonly ProtoId<TagPrototype> InvalidForGlobalSpawnSpellTag = "InvalidForGlobalSpawnSpell";
private static readonly ProtoId<TagPrototype> CannotSuicideTag = "CannotSuicide";
private static readonly ProtoId<NpcFactionPrototype> ZombieFaction = "Zombie";
/// <summary>
/// Handles an entity turning into a zombie when they die or go into crit
/// </summary>
@@ -223,7 +226,7 @@ public sealed partial class ZombieSystem
_mobState.ChangeMobState(target, MobState.Alive);
_faction.ClearFactions(target, dirty: false);
_faction.AddFaction(target, "Zombie");
_faction.AddFaction(target, ZombieFaction);
//gives it the funny "Zombie ___" name.
_nameMod.RefreshNameModifiers(target);