private void OnAtmosMonitorShutdown(EntityUid uid, AtmosMonitorComponent component, ComponentShutdown args)
 {
     if (_checkPos.Contains(uid))
     {
         _checkPos.Remove(uid);
     }
 }
        private void OnAtmosMonitorStartup(EntityUid uid, AtmosMonitorComponent component, ComponentStartup args)
        {
            if (!HasComp <ApcPowerReceiverComponent>(uid) &&
                TryComp <AtmosDeviceComponent>(uid, out var atmosDeviceComponent))
            {
                _atmosDeviceSystem.LeaveAtmosphere(atmosDeviceComponent);
                return;
            }

            _checkPos.Add(uid);
        }
Beispiel #3
0
        private void OnAtmosMonitorStartup(EntityUid uid, AtmosMonitorComponent component, ComponentStartup args)
        {
            if (component.PowerRecvComponent == null &&
                component.AtmosDeviceComponent != null)
            {
                _atmosDeviceSystem.LeaveAtmosphere(component.AtmosDeviceComponent);
                return;
            }

            _checkPos.Add(uid);
        }
        private void OnAtmosMonitorInit(EntityUid uid, AtmosMonitorComponent component, ComponentInit args)
        {
            if (component.TemperatureThresholdId != null)
            {
                component.TemperatureThreshold = _prototypeManager.Index <AtmosAlarmThreshold>(component.TemperatureThresholdId);
            }

            if (component.PressureThresholdId != null)
            {
                component.PressureThreshold = _prototypeManager.Index <AtmosAlarmThreshold>(component.PressureThresholdId);
            }

            if (component.GasThresholdIds != null)
            {
                component.GasThresholds = new();
                foreach (var(gas, id) in component.GasThresholdIds)
                {
                    if (_prototypeManager.TryIndex <AtmosAlarmThreshold>(id, out var gasThreshold))
                    {
                        component.GasThresholds.Add(gas, gasThreshold);
                    }
                }
            }
        }