public void DisconnectInternals(BreathToolComponent component)
    {
        var old = component.ConnectedInternalsEntity;

        component.ConnectedInternalsEntity = null;

        if (TryComp <InternalsComponent>(old, out var internalsComponent))
        {
            _internals.DisconnectBreathTool(internalsComponent);
        }

        component.IsFunctional = false;
    }
Exemplo n.º 2
0
    private void OnGotEquipped(EntityUid uid, BreathToolComponent component, GotEquippedEvent args)
    {
        if ((args.SlotFlags & component.AllowedSlots) != component.AllowedSlots)
        {
            return;
        }
        component.IsFunctional = true;

        if (TryComp(args.Equipee, out InternalsComponent? internals))
        {
            component.ConnectedInternalsEntity = args.Equipee;
            internals.ConnectBreathTool(uid);
        }
    }
Exemplo n.º 3
0
 private void OnGotUnequipped(EntityUid uid, BreathToolComponent component, GotUnequippedEvent args)
 {
     component.DisconnectInternals();
 }
Exemplo n.º 4
0
 private void OnGotUnequipped(EntityUid uid, BreathToolComponent component, GotUnequippedEvent args)
 {
     _atmosphereSystem.DisconnectInternals(component);
 }
 private void OnBreathToolShutdown(EntityUid uid, BreathToolComponent component, ComponentShutdown args)
 {
     DisconnectInternals(component);
 }