Defer physics transforms to ensure thread safety

Refactored multiple components to defer Farseer physics transform operations using PhysicsBodyQueue, preventing unsafe calls from parallel contexts. This change addresses thread safety issues with Farseer's DynamicTree and ensures transforms are executed in a safe context. Also increased the spawn amount limit in DebugConsole from 100 to 100000.
This commit is contained in:
Eero
2025-12-28 17:14:16 +08:00
parent 59bf2749dd
commit 1db14631df
6 changed files with 76 additions and 22 deletions
@@ -3225,7 +3225,7 @@ namespace Barotrauma
if (args.Length > spawnLocationIndex + 1)
{
if (!int.TryParse(args[spawnLocationIndex + 1], NumberStyles.Any, CultureInfo.InvariantCulture, out amount)) { amount = 1; }
amount = Math.Min(amount, 100);
amount = Math.Min(amount, 100000);
}
if (args.Length > spawnLocationIndex + 2)