Validate remaining ProtoId strings (#38747)

Validate remaining ProtoId strings
This commit is contained in:
Tayrtahn
2025-07-04 16:55:45 -04:00
committed by GitHub
parent 3a278bca8b
commit f09bade8e7
14 changed files with 44 additions and 23 deletions

View File

@@ -12,6 +12,8 @@ namespace Content.Shared.Humanoid
/// </summary>
public sealed class NamingSystem : EntitySystem
{
private static readonly ProtoId<SpeciesPrototype> FallbackSpecies = "Human";
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
@@ -21,8 +23,8 @@ namespace Content.Shared.Humanoid
// Some downstream is probably gonna have this eventually but then they can deal with fallbacks.
if (!_prototypeManager.TryIndex(species, out SpeciesPrototype? speciesProto))
{
speciesProto = _prototypeManager.Index<SpeciesPrototype>("Human");
Log.Warning($"Unable to find species {species} for name, falling back to Human");
speciesProto = _prototypeManager.Index(FallbackSpecies);
Log.Warning($"Unable to find species {species} for name, falling back to {FallbackSpecies}");
}
switch (speciesProto.Naming)