]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix PostMapInit tests not considering job containerspawns (#31538)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Wed, 28 Aug 2024 02:42:06 +0000 (12:42 +1000)
committerGitHub <noreply@github.com>
Wed, 28 Aug 2024 02:42:06 +0000 (12:42 +1000)
* Fix PostMapInit tests nto considering job containerspawns

* fix

Content.IntegrationTests/Tests/PostMapInitTest.cs
Content.Server/Spawners/Components/ContainerSpawnPointComponent.cs
Resources/Prototypes/Entities/Mobs/Player/silicon.yml

index d1172375b0fadf359321b916ea87a322d58f85e0..5771e0f06c088301c0d7c49d6474b64d1e19814a 100644 (file)
@@ -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<ContainerSpawnPointComponent>()
+                        .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}.");
                 }
 
index 5c8e3c4186b50e7352187d8eaebb7b753be328ca..210904b5671c0c1ce802e8a732a8a3b4fa4baf1d 100644 (file)
@@ -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
     /// </summary>
     [DataField, ViewVariables(VVAccess.ReadWrite)]
-    public string? Job;
+    public ProtoId<JobPrototype>? Job;
 
     /// <summary>
     /// The type of spawn point
index 686f575e8bb14ecb6ffbaaf8d41c963a8ea80215..23b2a318ebb24599c31876d34053668fcd63c141 100644 (file)
   suffix: Job spawn
   components:
   - type: ContainerSpawnPoint
+    spawnType: Job
     containerId: station_ai_mind_slot
     job: StationAi
   - type: Sprite