From: Perry Fraser Date: Tue, 17 Jun 2025 16:32:14 +0000 (-0400) Subject: fix: erase expedition disks when their map is deleted (#38322) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=3c297d0620443f76b9140e92ea6db544f58f8253;p=space-station-14.git fix: erase expedition disks when their map is deleted (#38322) * fix: erase expedition disks when their map is deleted * fix: include paused entities in disk query, add dirty --- diff --git a/Content.Server/Salvage/SalvageSystem.Expeditions.cs b/Content.Server/Salvage/SalvageSystem.Expeditions.cs index 466678be3d..aa31c465f8 100644 --- a/Content.Server/Salvage/SalvageSystem.Expeditions.cs +++ b/Content.Server/Salvage/SalvageSystem.Expeditions.cs @@ -6,6 +6,7 @@ using Content.Shared.CCVar; using Content.Shared.Examine; using Content.Shared.Random.Helpers; using Content.Shared.Salvage.Expeditions; +using Content.Shared.Shuttles.Components; using Robust.Shared.Audio; using Robust.Shared.CPUJob.JobQueues; using Robust.Shared.CPUJob.JobQueues.Queues; @@ -76,6 +77,15 @@ public sealed partial class SalvageSystem { component.Stream = _audio.Stop(component.Stream); + // First wipe any disks referencing us + var disks = AllEntityQuery(); + while (disks.MoveNext(out var disk, out var diskComp) + && diskComp.Destination == uid) + { + diskComp.Destination = null; + Dirty(disk, diskComp); + } + foreach (var (job, cancelToken) in _salvageJobs.ToArray()) { if (job.Station == component.Station)