Refactor actions to be entities with components (#19900)

This commit is contained in:
DrSmugleaf
2023-09-08 18:16:05 -07:00
committed by GitHub
parent e18f731b91
commit c71f97e3a2
210 changed files with 10693 additions and 11714 deletions

View File

@@ -1,6 +1,5 @@
using System.Linq;
using Content.Shared.Actions;
using Content.Shared.Actions.ActionTypes;
using Content.Shared.Implants.Components;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
@@ -36,9 +35,9 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
if (component.ImplantedEntity == null)
return;
if (component.ImplantAction != null)
if (!string.IsNullOrWhiteSpace(component.ImplantAction))
{
var action = new InstantAction(_prototypeManager.Index<InstantActionPrototype>(component.ImplantAction));
var action = Spawn(component.ImplantAction);
_actionsSystem.AddAction(component.ImplantedEntity.Value, action, uid);
}