threshold cloning

This commit is contained in:
vulppine
2022-08-17 20:52:04 -07:00
parent b075606f61
commit 32e2686a4b
2 changed files with 12 additions and 3 deletions

View File

@@ -75,17 +75,17 @@ namespace Content.Server.Atmos.Monitor.Systems
private void OnAtmosMonitorInit(EntityUid uid, AtmosMonitorComponent component, ComponentInit args)
{
if (component.TemperatureThresholdId != null)
component.TemperatureThreshold = _prototypeManager.Index<AtmosAlarmThreshold>(component.TemperatureThresholdId);
component.TemperatureThreshold = new(_prototypeManager.Index<AtmosAlarmThreshold>(component.TemperatureThresholdId));
if (component.PressureThresholdId != null)
component.PressureThreshold = _prototypeManager.Index<AtmosAlarmThreshold>(component.PressureThresholdId);
component.PressureThreshold = new(_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);
component.GasThresholds.Add(gas, new(gasThreshold));
}
}