From 9474f7654cd003799e0932866e70709ead386099 Mon Sep 17 00:00:00 2001 From: Eero Date: Mon, 29 Dec 2025 18:37:13 +0800 Subject: [PATCH] CBT2.0.1 Fix event reset and temp cell clearing logic Changed ResetReceivedEvents from partial to regular method in EntitySpawner to ensure proper event queue clearing. Updated Level.cs to clear tempCellsLocal instead of tempCells, addressing potential issues with thread-local storage. --- .../BarotraumaClient/ClientSource/Networking/EntitySpawner.cs | 2 +- Barotrauma/BarotraumaShared/SharedSource/Map/Levels/Level.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaClient/ClientSource/Networking/EntitySpawner.cs b/Barotrauma/BarotraumaClient/ClientSource/Networking/EntitySpawner.cs index f8c7e7d45..239150c38 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Networking/EntitySpawner.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Networking/EntitySpawner.cs @@ -23,7 +23,7 @@ namespace Barotrauma /// /// Clears all received events from the queue. /// - partial void ResetReceivedEvents() + void ResetReceivedEvents() { while (receivedEventsQueue.TryDequeue(out _)) { } } diff --git a/Barotrauma/BarotraumaShared/SharedSource/Map/Levels/Level.cs b/Barotrauma/BarotraumaShared/SharedSource/Map/Levels/Level.cs index d0ddf3fe9..f4d5e5d6a 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Map/Levels/Level.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Map/Levels/Level.cs @@ -5189,7 +5189,7 @@ namespace Barotrauma UnsyncedExtraWalls = null; } - tempCells?.Clear(); + tempCellsLocal?.Value?.Clear(); cells = null; cellGrid = null;