From c29896f505db28bf3dca9af9e6f0430dcf0f4629 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Tue, 16 Jan 2024 02:58:04 -0500 Subject: [PATCH] fix radiators leaking heat into atmos blocked tiles (#24124) * fix radiators leaking heat into atmos blocked tiles * Fix the fix Pointyhat to: emogarbage * Remove unused imports --------- Co-authored-by: Kevin Zheng --- .../Atmos/EntitySystems/HeatExchangerSystem.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Content.Server/Atmos/EntitySystems/HeatExchangerSystem.cs b/Content.Server/Atmos/EntitySystems/HeatExchangerSystem.cs index a71174d4d3..af73bcd7f9 100644 --- a/Content.Server/Atmos/EntitySystems/HeatExchangerSystem.cs +++ b/Content.Server/Atmos/EntitySystems/HeatExchangerSystem.cs @@ -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