Replace ValidatePrototypeId uses with ProtoId or EntProtoId (#38814)

* The easy ones

* For certain values of easy

* Easy test

* Hair

* Fix sandbox violations

* Sort usings
This commit is contained in:
Tayrtahn
2025-07-07 15:57:05 -04:00
committed by GitHub
parent 41f737e8f3
commit c565b44965
77 changed files with 187 additions and 297 deletions

View File

@@ -58,12 +58,8 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly TurfSystem _turf = default!;
[ValidatePrototypeId<StatusEffectPrototype>]
private const string StatusEffectKey = "Electrocution";
[ValidatePrototypeId<DamageTypePrototype>]
private const string DamageType = "Shock";
private static readonly ProtoId<StatusEffectPrototype> StatusEffectKey = "Electrocution";
private static readonly ProtoId<DamageTypePrototype> DamageType = "Shock";
private static readonly ProtoId<TagPrototype> WindowTag = "Window";
// Multiply and shift the log scale for shock damage.
@@ -408,7 +404,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
if (shockDamage is { } dmg)
{
var actual = _damageable.TryChangeDamage(uid,
new DamageSpecifier(_prototypeManager.Index<DamageTypePrototype>(DamageType), dmg), origin: sourceUid);
new DamageSpecifier(_prototypeManager.Index(DamageType), dmg), origin: sourceUid);
if (actual != null)
{