Refactor actions to be entities with components (#19900)
This commit is contained in:
@@ -4,6 +4,7 @@ using Content.Server.Ghost.Roles.Events;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Bible;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Interaction;
|
||||
@@ -179,8 +180,9 @@ namespace Content.Server.Bible
|
||||
if (component.AlreadySummoned)
|
||||
return;
|
||||
|
||||
args.Actions.Add(component.SummonAction);
|
||||
args.AddAction(ref component.SummonActionEntity, component.SummonAction);
|
||||
}
|
||||
|
||||
private void OnSummon(EntityUid uid, SummonableComponent component, SummonActionEvent args)
|
||||
{
|
||||
AttemptSummon(component, args.Performer, Transform(args.Performer));
|
||||
@@ -238,12 +240,7 @@ namespace Content.Server.Bible
|
||||
Transform(familiar).AttachParent(component.Owner);
|
||||
}
|
||||
component.AlreadySummoned = true;
|
||||
_actionsSystem.RemoveAction(user, component.SummonAction);
|
||||
_actionsSystem.RemoveAction(user, component.SummonActionEntity);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed partial class SummonActionEvent : InstantActionEvent
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user