Unstable Add thread-safe queue for deferred physics body creation
Introduces PhysicsBodyQueue to safely defer physics body creation to the main thread, addressing thread-safety issues with Farseer Physics during parallel updates. Updates LevelResource, TriggerComponent, BallastFloraBehavior, and MapEntity to use the queue for all physics body creation and refresh operations, ensuring they are processed outside of parallel loops. Also adds cleanup of the queue at round end.
This commit is contained in:
@@ -1153,6 +1153,7 @@ namespace Barotrauma
|
||||
EventManager?.EndRound();
|
||||
StatusEffect.StopAll();
|
||||
AfflictionPrefab.ClearAllEffects();
|
||||
PhysicsBodyQueue.Clear();
|
||||
IsRunning = false;
|
||||
|
||||
#if CLIENT
|
||||
|
||||
Reference in New Issue
Block a user