private void OnActorShutdown(EntityUid entity, ActorComponent component, ComponentShutdown args) { component.PlayerSession.SetAttachedEntity(null); // The player is fully detached now that the component has shut down. RaiseLocalEvent(entity, new PlayerDetachedEvent(entity, component.PlayerSession)); }
private void OnActorShutdown(EntityUid uid, ActorComponent component, ComponentShutdown args) { component.PlayerSession.SetAttachedEntity(null); var entity = EntityManager.GetEntity(uid); // TODO: Remove component message. entity.SendMessage(component, new PlayerDetachedMsg(component.PlayerSession)); // The player is fully detached now that the component has shut down. RaiseLocalEvent(uid, new PlayerDetachedEvent(entity, component.PlayerSession)); }
// Not gonna make this method call Detach as all we have to do is remove a component... private void OnActorPlayerDetach(EntityUid uid, ActorComponent component, DetachPlayerEvent args) { // Removing the component will call shutdown, and our subscription will handle the rest of the detach logic. EntityManager.RemoveComponent <ActorComponent>(uid); args.Result = true; }