From d2bee7ec91fef6cb2a1ee9b2aada98ae1ba136f3 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 1 Apr 2024 09:45:40 +1300 Subject: [PATCH] Fix GastTileOverlay sending redundant data (#26623) Fix GastTileOverlay not updating properly --- .../Atmos/EntitySystems/GasTileOverlaySystem.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs b/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs index c42cfd08da..89b9c52078 100644 --- a/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs +++ b/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs @@ -432,14 +432,16 @@ namespace Content.Server.Atmos.EntitySystems if (!overlay.Chunks.TryGetValue(gIndex, out var value)) continue; - if (previousChunks != null && - previousChunks.Contains(gIndex) && - value.LastUpdate > LastSessionUpdate) + // If the chunk was updated since we last sent it, send it again + if (value.LastUpdate > LastSessionUpdate) { + dataToSend.Add(value); continue; } - dataToSend.Add(value); + // Always send it if we didn't previously send it + if (previousChunks == null || !previousChunks.Contains(gIndex)) + dataToSend.Add(value); } previouslySent[netGrid] = gridChunks; -- 2.51.2