]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Enforce Space Heater max/min temperatures server side (#25835)
authorMenshin <Menshin@users.noreply.github.com>
Tue, 5 Mar 2024 15:57:28 +0000 (16:57 +0100)
committerGitHub <noreply@github.com>
Tue, 5 Mar 2024 15:57:28 +0000 (16:57 +0100)
Actually enforce max/min temperatures server side

Content.Server/Atmos/Portable/SpaceHeaterSystem.cs

index b7336a74717ab5b343bf77dc3c6b1b959fe9daa6..16311328218623d5097580f68ec0f48cf052db2c 100644 (file)
@@ -109,7 +109,7 @@ public sealed class SpaceHeaterSystem : EntitySystem
         if (!TryComp<GasThermoMachineComponent>(uid, out var thermoMachine))
             return;
 
-        thermoMachine.TargetTemperature += args.Temperature;
+        thermoMachine.TargetTemperature = float.Clamp(thermoMachine.TargetTemperature + args.Temperature, thermoMachine.MinTemperature, thermoMachine.MaxTemperature);
 
         UpdateAppearance(uid);
         DirtyUI(uid, spaceHeater);