Skip to content

Commit

Permalink
Fix PostMapInit tests not considering job containerspawns (#31538)
Browse files Browse the repository at this point in the history
* Fix PostMapInit tests nto considering job containerspawns

* fix
  • Loading branch information
metalgearsloth authored Aug 28, 2024
1 parent 14b3e0c commit 99a41a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes;
using Content.Shared.Station.Components;
using FastAccessors;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;

Expand Down Expand Up @@ -251,6 +252,13 @@ await server.WaitPost(() =>
.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}.");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Content.Server.Spawners.EntitySystems;
using Content.Shared.Roles;
using Robust.Shared.Prototypes;

namespace Content.Server.Spawners.Components;

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Entities/Mobs/Player/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
suffix: Job spawn
components:
- type: ContainerSpawnPoint
spawnType: Job
containerId: station_ai_mind_slot
job: StationAi
- type: Sprite
Expand Down

0 comments on commit 99a41a1

Please sign in to comment.