Content changes for session specific entity states (#11235)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user