From 6faf1a0fcba66d2532b26683aa1e710587a3f282 Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Sat, 24 Jan 2026 15:52:29 -0300 Subject: [PATCH] Fix perfidious task moment --- .../LuaCs/Services/Processing/ModConfigService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Services/Processing/ModConfigService.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Services/Processing/ModConfigService.cs index 6025fce08..f1329f262 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Services/Processing/ModConfigService.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Services/Processing/ModConfigService.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Xml.Linq; +using Barotrauma.Extensions; using Barotrauma.LuaCs.Data; using FluentResults; using Microsoft.Toolkit.Diagnostics; @@ -120,12 +121,15 @@ public sealed class ModConfigService : IModConfigService ImmutableArray configResources = default; ImmutableArray luaResources = default; - var res = await Task.WhenAll(new[] + var tasks = new[] { new Task(async () => assemblyResources = await GetAssembliesFromXml(owner, src)), new Task(async () => configResources = await GetConfigsFromXml(owner, src)), new Task(async () => luaResources = await GetLuaScriptsFromXml(owner, src)), - }); + }; + + tasks.ForEach(t => t.Start()); + var res = await Task.WhenAll(tasks); bool isFaulted = false; foreach (var task in res)