Content changes for session specific entity states (#11235)
This commit is contained in:
@@ -39,32 +39,6 @@ namespace Content.Server.Flash
|
||||
SubscribeLocalEvent<InventoryComponent, FlashAttemptEvent>(OnInventoryFlashAttempt);
|
||||
|
||||
SubscribeLocalEvent<FlashImmunityComponent, FlashAttemptEvent>(OnFlashImmunityFlashAttempt);
|
||||
|
||||
SubscribeLocalEvent<FlashableComponent, ComponentStartup>(OnFlashableStartup);
|
||||
SubscribeLocalEvent<FlashableComponent, ComponentShutdown>(OnFlashableShutdown);
|
||||
SubscribeLocalEvent<FlashableComponent, MetaFlagRemoveAttemptEvent>(OnMetaFlagRemoval);
|
||||
SubscribeLocalEvent<FlashableComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, FlashableComponent component, PlayerAttachedEvent args)
|
||||
{
|
||||
Dirty(component);
|
||||
}
|
||||
|
||||
private void OnMetaFlagRemoval(EntityUid uid, FlashableComponent component, ref MetaFlagRemoveAttemptEvent args)
|
||||
{
|
||||
if (component.LifeStage == ComponentLifeStage.Running)
|
||||
args.ToRemove &= ~MetaDataFlags.EntitySpecific;
|
||||
}
|
||||
|
||||
private void OnFlashableStartup(EntityUid uid, FlashableComponent component, ComponentStartup args)
|
||||
{
|
||||
_metaSystem.AddFlag(uid, MetaDataFlags.EntitySpecific);
|
||||
}
|
||||
|
||||
private void OnFlashableShutdown(EntityUid uid, FlashableComponent component, ComponentShutdown args)
|
||||
{
|
||||
_metaSystem.RemoveFlag(uid, MetaDataFlags.EntitySpecific);
|
||||
}
|
||||
|
||||
private void OnFlashMeleeHit(EntityUid uid, FlashComponent comp, MeleeHitEvent args)
|
||||
|
||||
Reference in New Issue
Block a user