]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix GastTileOverlay sending redundant data (#26623)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Sun, 31 Mar 2024 20:45:40 +0000 (09:45 +1300)
committerGitHub <noreply@github.com>
Sun, 31 Mar 2024 20:45:40 +0000 (16:45 -0400)
Fix GastTileOverlay not updating properly

Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs

index c42cfd08da3dd05fbbdcc39c53bf80c7de627225..89b9c520787343c2d97fd26927bb453c6cf038b7 100644 (file)
@@ -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;