From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 28 Aug 2024 02:42:06 +0000 (+1000) Subject: Fix PostMapInit tests not considering job containerspawns (#31538) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=99a41a12ab05ccb477ebe54f7d265666dc607be1;p=space-station-14.git Fix PostMapInit tests not considering job containerspawns (#31538) * Fix PostMapInit tests nto considering job containerspawns * fix --- diff --git a/Content.IntegrationTests/Tests/PostMapInitTest.cs b/Content.IntegrationTests/Tests/PostMapInitTest.cs index d1172375b0..5771e0f06c 100644 --- a/Content.IntegrationTests/Tests/PostMapInitTest.cs +++ b/Content.IntegrationTests/Tests/PostMapInitTest.cs @@ -17,6 +17,7 @@ using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Prototypes; using Content.Shared.Station.Components; +using FastAccessors; using Robust.Shared.Utility; using YamlDotNet.RepresentationModel; @@ -251,6 +252,13 @@ namespace Content.IntegrationTests.Tests .Select(x => x.Job!.Value); jobs.ExceptWith(spawnPoints); + + spawnPoints = entManager.EntityQuery() + .Where(x => x.SpawnType == SpawnPointType.Job) + .Select(x => x.Job!.Value); + + jobs.ExceptWith(spawnPoints); + Assert.That(jobs, Is.Empty, $"There is no spawnpoints for {string.Join(", ", jobs)} on {mapProto}."); } diff --git a/Content.Server/Spawners/Components/ContainerSpawnPointComponent.cs b/Content.Server/Spawners/Components/ContainerSpawnPointComponent.cs index 5c8e3c4186..210904b567 100644 --- a/Content.Server/Spawners/Components/ContainerSpawnPointComponent.cs +++ b/Content.Server/Spawners/Components/ContainerSpawnPointComponent.cs @@ -1,4 +1,6 @@ using Content.Server.Spawners.EntitySystems; +using Content.Shared.Roles; +using Robust.Shared.Prototypes; namespace Content.Server.Spawners.Components; @@ -20,7 +22,7 @@ public sealed partial class ContainerSpawnPointComponent : Component, ISpawnPoin /// An optional job specifier /// [DataField, ViewVariables(VVAccess.ReadWrite)] - public string? Job; + public ProtoId? Job; /// /// The type of spawn point diff --git a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml index 686f575e8b..23b2a318eb 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml @@ -232,6 +232,7 @@ suffix: Job spawn components: - type: ContainerSpawnPoint + spawnType: Job containerId: station_ai_mind_slot job: StationAi - type: Sprite