From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 3 Apr 2023 04:53:24 +0000 (+1200) Subject: Fix instant awaited DoAfters (#15088) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=6e1fa571557d1194423c73a3f148b1c254a30e1b;p=space-station-14.git Fix instant awaited DoAfters (#15088) --- diff --git a/Content.Shared/DoAfter/SharedDoAfterSystem.cs b/Content.Shared/DoAfter/SharedDoAfterSystem.cs index 7d0efb91aa..2a666d6d96 100644 --- a/Content.Shared/DoAfter/SharedDoAfterSystem.cs +++ b/Content.Shared/DoAfter/SharedDoAfterSystem.cs @@ -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(); component.AwaitedDoAfters.Add(id.Value.Index, tcs); return await tcs.Task;