Content changes for session specific entity states (#11235)

This commit is contained in:
Leon Friedrich
2022-09-14 21:40:05 +12:00
committed by GitHub
parent 7cd0677708
commit 2908cd994c
12 changed files with 10 additions and 118 deletions

View File

@@ -16,33 +16,6 @@ namespace Content.Server.Actions
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ActionsComponent, PlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<ActionsComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<ActionsComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<ActionsComponent, MetaFlagRemoveAttemptEvent>(OnMetaFlagRemoval);
}
private void OnMetaFlagRemoval(EntityUid uid, ActionsComponent component, ref MetaFlagRemoveAttemptEvent args)
{
if (component.LifeStage == ComponentLifeStage.Running)
args.ToRemove &= ~MetaDataFlags.EntitySpecific;
}
private void OnStartup(EntityUid uid, ActionsComponent component, ComponentStartup args)
{
_metaSystem.AddFlag(uid, MetaDataFlags.EntitySpecific);
}
private void OnShutdown(EntityUid uid, ActionsComponent component, ComponentShutdown args)
{
_metaSystem.RemoveFlag(uid, MetaDataFlags.EntitySpecific);
}
private void OnPlayerAttached(EntityUid uid, ActionsComponent component, PlayerAttachedEvent args)
{
// need to send state to new player.
Dirty(component);
}
protected override bool PerformBasicActions(EntityUid user, ActionType action)