OBT/1.0.14

Fixed parallelism count issue
Added SingleThreadWorker to handle single-thread related works
Fixed incorrect order when updating gaps
Potentially Fixed #39
This commit is contained in:
NotAlwaysTrue
2026-01-08 12:40:30 +08:00
committed by GitHub
parent f3c22315a1
commit 8bfe8a2c37
5 changed files with 53 additions and 19 deletions
@@ -681,12 +681,12 @@ namespace Barotrauma
{
// if crashed, go ask the god damn physics engine :(
var shuffledGaps = gapList.OrderBy(g => Rand.Int(int.MaxValue)).ToList();
Parallel.ForEach(gapList, parallelOptions, gap =>
Parallel.ForEach(shuffledGaps, parallelOptions, gap =>
{
gap.ResetWaterFlowThisFrame();
gap.Update(deltaTime, cam);
});
FarseerPhysics.Dynamics.Body.QueueDisable();
SingleThreadWorker.GlobalWorker.RunActions();
},
// Powered components update
() =>