Fix GastTileOverlay sending redundant data (#26623)

Fix GastTileOverlay not updating properly

(cherry picked from commit d2bee7ec91fef6cb2a1ee9b2aada98ae1ba136f3)
This commit is contained in:
Leon Friedrich 2024-04-01 09:45:40 +13:00 committed by NullWanderer
parent 635ff88190
commit 89ac535f6c
No known key found for this signature in database
GPG Key ID: 65CF92BD1D26F4AC
1 changed files with 6 additions and 4 deletions

View 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;