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

@@ -8,6 +8,8 @@ namespace Content.Shared.Chat;
public sealed class SharedSuicideSystem : EntitySystem
{
private static readonly ProtoId<DamageTypePrototype> FallbackDamageType = "Blunt";
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
@@ -57,8 +59,8 @@ public sealed class SharedSuicideSystem : EntitySystem
// We don't want structural damage for the same reasons listed above
if (!_prototypeManager.TryIndex(damageType, out var damagePrototype) || damagePrototype.ID == "Structural")
{
Log.Error($"{nameof(SharedSuicideSystem)} could not find the damage type prototype associated with {damageType}. Falling back to Blunt");
damagePrototype = _prototypeManager.Index<DamageTypePrototype>("Blunt");
Log.Error($"{nameof(SharedSuicideSystem)} could not find the damage type prototype associated with {damageType}. Falling back to {FallbackDamageType}");
damagePrototype = _prototypeManager.Index(FallbackDamageType);
}
var damage = new DamageSpecifier(damagePrototype, lethalAmountOfDamage);