Fixed multiple LINQ using shared resources and cause crashes
Added an null check in AIObjectiveManager.cs to avoid accessing removed resources Use shuffledGaps instead of gapList to ensure update order requirement(already in master) Updated parallelism count
This commit is contained in:
@@ -816,7 +816,7 @@ namespace Barotrauma
|
||||
|
||||
// Gap update (has order dependencies, keep random order but execute sequentially)
|
||||
var shuffledGaps = gapList.OrderBy(g => Rand.Int(int.MaxValue)).ToList();
|
||||
Parallel.ForEach(gapList, parallelOptions, gap =>
|
||||
Parallel.ForEach(shuffledGaps, parallelOptions, gap =>
|
||||
{
|
||||
PhysicsBodyQueue.IsInParallelContext = true;
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user