From 8cf5f93b9f95e8932d39712aedb06e163d65c078 Mon Sep 17 00:00:00 2001 From: Jajsha <101492056+Zap527@users.noreply.github.com> Date: Sat, 19 Oct 2024 23:43:17 -0400 Subject: [PATCH] Fix starting gear multiple storage fills and tests (#32718) * fix things * maybe fix everything --- .../Tests/Roles/StartingGearStorageTests.cs | 14 +++++++------- .../Station/SharedStationSpawningSystem.cs | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) 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;