]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix radiators leaking heat into atmos blocked tiles (#24124)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Tue, 16 Jan 2024 07:58:04 +0000 (02:58 -0500)
committerGitHub <noreply@github.com>
Tue, 16 Jan 2024 07:58:04 +0000 (18:58 +1100)
* fix radiators leaking heat into atmos blocked tiles

* Fix the fix

Pointyhat to: emogarbage

* Remove unused imports

---------

Co-authored-by: Kevin Zheng <kevinz5000@gmail.com>
Content.Server/Atmos/EntitySystems/HeatExchangerSystem.cs

index a71174d4d36f9fc98bc6efbc24e533e1551068f5..af73bcd7f90cbf6f95a59b6482691eaf00cb7ea7 100644 (file)
@@ -20,6 +20,7 @@ public sealed class HeatExchangerSystem : EntitySystem
     [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
     [Dependency] private readonly IConfigurationManager _cfg = default!;
     [Dependency] private readonly NodeContainerSystem _nodeContainer = default!;
+    [Dependency] private readonly SharedTransformSystem _transform = default!;
 
     float tileLoss;
 
@@ -53,6 +54,17 @@ public sealed class HeatExchangerSystem : EntitySystem
             return;
         }
 
+        // make sure that the tile the device is on isn't blocked by a wall or something similar.
+        var xform = Transform(uid);
+        if (_transform.TryGetGridTilePosition(uid, out var tile))
+        {
+            // TryGetGridTilePosition() already returns false if GridUid is null, but the null checker isn't smart enough yet
+            if (xform.GridUid != null && _atmosphereSystem.IsTileAirBlocked(xform.GridUid.Value, tile))
+            {
+                return;
+            }
+        }
+
         var dt = args.dt;
 
         // Let n = moles(inlet) - moles(outlet), really a Δn