Validate remaining ProtoId strings (#38747)
Validate remaining ProtoId strings
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user