From 8bb0c80c106c72b7b24c053d9ebcdb9a8374514d Mon Sep 17 00:00:00 2001 From: Finket Date: Thu, 22 Feb 2024 09:48:55 +0200 Subject: [PATCH] Switch to const action prototypes with validators --- .../Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs | 6 ++++-- .../Species/Shadowkin/Systems/ShadowkinPowerSystem.Rest.cs | 5 +++-- .../Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs index a34980f2fa..e2afc3b549 100644 --- a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs +++ b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs @@ -15,7 +15,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; - +using Robust.Shared.Prototypes; namespace Content.Server.SimpleStation14.Species.Shadowkin.Systems; @@ -32,6 +32,8 @@ public sealed class ShadowkinDarkSwapSystem : EntitySystem [Dependency] private readonly MagicSystem _magic = default!; [Dependency] private readonly NpcFactionSystem _factions = default!; + [ValidatePrototypeId] + private const string ActionShadowkinDarkSwapId = "ActionShadowkinDarkSwap"; public override void Initialize() { @@ -50,7 +52,7 @@ public override void Initialize() private void Startup(EntityUid uid, ShadowkinDarkSwapPowerComponent component, ComponentStartup args) { var componentActionShadowkinDarkSwap = component.ActionShadowkinDarkSwap; - _actions.AddAction(uid, ref componentActionShadowkinDarkSwap, "ActionShadowkinDarkSwap"); + _actions.AddAction(uid, ref componentActionShadowkinDarkSwap, ActionShadowkinDarkSwapId); } private void Shutdown(EntityUid uid, ShadowkinDarkSwapPowerComponent component, ComponentShutdown args) diff --git a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Rest.cs b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Rest.cs index af4f80d9c8..9d30c8c827 100644 --- a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Rest.cs +++ b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Rest.cs @@ -11,10 +11,11 @@ namespace Content.Server.SimpleStation14.Species.Shadowkin.Systems; public sealed class ShadowkinRestSystem : EntitySystem { [Dependency] private readonly IEntityManager _entity = default!; - [Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly SharedActionsSystem _actions = default!; [Dependency] private readonly ShadowkinPowerSystem _power = default!; + [ValidatePrototypeId] + private const string ActionShadowkinRestId = "ActionShadowkinRest"; public override void Initialize() { @@ -30,7 +31,7 @@ public override void Initialize() private void OnStartup(EntityUid uid, ShadowkinRestPowerComponent component, ComponentStartup args) { var componentActionShadowkinRest = component.ActionShadowkinRest; - _actions.AddAction(uid, ref componentActionShadowkinRest, "ActionShadowkinRest"); + _actions.AddAction(uid, ref componentActionShadowkinRest, ActionShadowkinRestId); } private void OnShutdown(EntityUid uid, ShadowkinRestPowerComponent component, ComponentShutdown args) diff --git a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs index c15b68d45c..268be80e13 100644 --- a/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs +++ b/Content.Server/SimpleStation14/Species/Shadowkin/Systems/ShadowkinPowerSystem.Teleport.cs @@ -22,9 +22,10 @@ public sealed class ShadowkinTeleportSystem : EntitySystem [Dependency] private readonly StaminaSystem _stamina = default!; [Dependency] private readonly PullingSystem _pulling = default!; [Dependency] private readonly SharedActionsSystem _actions = default!; - [Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly MagicSystem _magic = default!; + [ValidatePrototypeId] + private const string ActionShadowkinTeleportId = "ActionShadowkinTeleport"; public override void Initialize() { @@ -40,7 +41,7 @@ public override void Initialize() private void Startup(EntityUid uid, ShadowkinTeleportPowerComponent component, ComponentStartup args) { var componentActionShadowkinTeleport = component.ActionShadowkinTeleport; - _actions.AddAction(uid, ref componentActionShadowkinTeleport, "ActionShadowkinTeleport"); + _actions.AddAction(uid, ref componentActionShadowkinTeleport, ActionShadowkinTeleportId); } private void Shutdown(EntityUid uid, ShadowkinTeleportPowerComponent component, ComponentShutdown args)