From: Jajsha <101492056+Zap527@users.noreply.github.com> Date: Sun, 20 Oct 2024 03:43:17 +0000 (-0400) Subject: Fix starting gear multiple storage fills and tests (#32718) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=8cf5f93b9f95e8932d39712aedb06e163d65c078;p=space-station-14.git Fix starting gear multiple storage fills and tests (#32718) * fix things * maybe fix everything --- diff --git a/Content.IntegrationTests/Tests/Roles/StartingGearStorageTests.cs b/Content.IntegrationTests/Tests/Roles/StartingGearStorageTests.cs index f8060edb2b..3b2935258a 100644 --- a/Content.IntegrationTests/Tests/Roles/StartingGearStorageTests.cs +++ b/Content.IntegrationTests/Tests/Roles/StartingGearStorageTests.cs @@ -35,15 +35,16 @@ public sealed class StartingGearPrototypeStorageTest { foreach (var gearProto in protos) { - var backpackProto = ((IEquipmentLoadout) gearProto).GetGear("back"); - if (backpackProto == string.Empty) - continue; - - var bag = server.EntMan.SpawnEntity(backpackProto, coords); var ents = new ValueList(); foreach (var (slot, entProtos) in gearProto.Storage) { + ents.Clear(); + var storageProto = ((IEquipmentLoadout)gearProto).GetGear(slot); + if (storageProto == string.Empty) + continue; + + var bag = server.EntMan.SpawnEntity(storageProto, coords); if (entProtos.Count == 0) continue; @@ -59,9 +60,8 @@ public sealed class StartingGearPrototypeStorageTest server.EntMan.DeleteEntity(ent); } + server.EntMan.DeleteEntity(bag); } - - server.EntMan.DeleteEntity(bag); } mapManager.DeleteMap(testMap.MapId); diff --git a/Content.Shared/Station/SharedStationSpawningSystem.cs b/Content.Shared/Station/SharedStationSpawningSystem.cs index 0584b10562..ad264cd22a 100644 --- a/Content.Shared/Station/SharedStationSpawningSystem.cs +++ b/Content.Shared/Station/SharedStationSpawningSystem.cs @@ -150,6 +150,7 @@ public abstract class SharedStationSpawningSystem : EntitySystem foreach (var (slot, entProtos) in startingGear.Storage) { + ents.Clear(); if (entProtos.Count == 0) continue;