]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix instant awaited DoAfters (#15088)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Mon, 3 Apr 2023 04:53:24 +0000 (16:53 +1200)
committerGitHub <noreply@github.com>
Mon, 3 Apr 2023 04:53:24 +0000 (14:53 +1000)
Content.Shared/DoAfter/SharedDoAfterSystem.cs

index 7d0efb91aa7e941d601ceca36c1bba257e168a2c..2a666d6d965f66220c6b72b6e7003fae863e3be0 100644 (file)
@@ -139,6 +139,12 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
         if (!TryStartDoAfter(doAfter, out var id, component))
             return DoAfterStatus.Cancelled;
 
+        if (doAfter.Delay <= TimeSpan.Zero)
+        {
+            Logger.Warning("Awaited instant DoAfters are not supported fully supported");
+            return DoAfterStatus.Finished;
+        }
+
         var tcs = new TaskCompletionSource<DoAfterStatus>();
         component.AwaitedDoAfters.Add(id.Value.Index, tcs);
         return await tcs.Task;