]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix salvage magnet determinism (#23655)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sun, 7 Jan 2024 03:23:44 +0000 (14:23 +1100)
committerGitHub <noreply@github.com>
Sun, 7 Jan 2024 03:23:44 +0000 (14:23 +1100)
Machine-specific moment, you'd think I'd remember from expeditions.

Content.Shared/Salvage/SharedSalvageSystem.Magnet.cs

index f1fff0bbc592bcc1867bc2897d3eaa5d7be5c58d..4847b3479300feca5d78f7d6b5ecd8f79ad7ba30 100644 (file)
@@ -2,6 +2,7 @@ using Content.Shared.Procedural;
 using Content.Shared.Procedural.PostGeneration;
 using Content.Shared.Random.Helpers;
 using Content.Shared.Salvage.Magnet;
+using Content.Shared.Store;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 
@@ -58,6 +59,7 @@ public abstract partial class SharedSalvageSystem
         // Salvage map seed
         _salvageMaps.Clear();
         _salvageMaps.AddRange(_proto.EnumeratePrototypes<SalvageMapPrototype>());
+        _salvageMaps.Sort((x, y) => string.Compare(x.ID, y.ID, StringComparison.Ordinal));
         var mapIndex = rand.Next(_salvageMaps.Count);
         var map = _salvageMaps[mapIndex];