From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Tue, 16 May 2023 12:55:49 +0000 (+1000) Subject: Fix salvage deletion (#16502) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=e468017152a6694aa5625447227bc3dec4c7fce9;p=space-station-14.git Fix salvage deletion (#16502) --- diff --git a/Content.Server/Salvage/SalvageSystem.Expeditions.cs b/Content.Server/Salvage/SalvageSystem.Expeditions.cs index e5bbce38ea..31a1c5fd63 100644 --- a/Content.Server/Salvage/SalvageSystem.Expeditions.cs +++ b/Content.Server/Salvage/SalvageSystem.Expeditions.cs @@ -146,16 +146,6 @@ public sealed partial class SalvageSystem GenerateMissions(comp); UpdateConsoles(comp); } - - var query = EntityQueryEnumerator(); - - while (query.MoveNext(out var uid, out var comp)) - { - if (comp.EndTime < currentTime) - { - QueueDel(uid); - } - } } private void FinishExpedition(SalvageExpeditionDataComponent component, SalvageExpeditionComponent expedition, EntityUid? shuttle) diff --git a/Content.Server/Salvage/SalvageSystem.Runner.cs b/Content.Server/Salvage/SalvageSystem.Runner.cs index 710fb9f84e..01f7340d42 100644 --- a/Content.Server/Salvage/SalvageSystem.Runner.cs +++ b/Content.Server/Salvage/SalvageSystem.Runner.cs @@ -122,9 +122,6 @@ public sealed partial class SalvageSystem // Run the basic mission timers (e.g. announcements, auto-FTL, completion, etc) while (query.MoveNext(out var uid, out var comp)) { - if (comp.Completed) - continue; - var remaining = comp.EndTime - _timing.CurTime; if (comp.Stage < ExpeditionStage.FinalCountdown && remaining < TimeSpan.FromSeconds(30)) @@ -174,6 +171,11 @@ public sealed partial class SalvageSystem } } } + + if (remaining < TimeSpan.Zero) + { + QueueDel(uid); + } } // Mining missions: NOOP