From 2d03cc63b6ed9d1d23e8d82714bf568e1f21af7f Mon Sep 17 00:00:00 2001 From: Debug <49997488+DebugOk@users.noreply.github.com> Date: Wed, 31 Jan 2024 23:02:05 +0100 Subject: [PATCH] Add prisoner latejoin cryopod (#751) --- .../EntitySystems/ContainerSpawnPointSystem.cs | 14 ++++++++++++-- .../DeltaV/Entities/Structures/cryopod.yml | 9 +++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 Resources/Prototypes/DeltaV/Entities/Structures/cryopod.yml diff --git a/Content.Server/Spawners/EntitySystems/ContainerSpawnPointSystem.cs b/Content.Server/Spawners/EntitySystems/ContainerSpawnPointSystem.cs index fcb6fdb039b..f6e923ec310 100644 --- a/Content.Server/Spawners/EntitySystems/ContainerSpawnPointSystem.cs +++ b/Content.Server/Spawners/EntitySystems/ContainerSpawnPointSystem.cs @@ -26,8 +26,8 @@ private void OnSpawnPlayer(PlayerSpawningEvent args) if (args.SpawnResult != null) return; - // DeltaV - Prevent spawnpoint overrides from being ignored - if (args.DesiredSpawnPointType != null && args.DesiredSpawnPointType != SpawnPointType.Unset) + // DeltaV - Ignore these two desired spawn types + if (args.DesiredSpawnPointType is SpawnPointType.Observer or SpawnPointType.LateJoin) return; var query = EntityQueryEnumerator(); @@ -38,6 +38,16 @@ private void OnSpawnPlayer(PlayerSpawningEvent args) if (args.Station != null && _station.GetOwningStation(uid, xform) != args.Station) continue; + // DeltaV - Custom override for override spawnpoints, only used for prisoners currently. This shouldn't run for any other jobs + if (args.DesiredSpawnPointType == SpawnPointType.Job) + { + if (spawnPoint.SpawnType != SpawnPointType.Job || spawnPoint.Job != args.Job?.Prototype) + continue; + + possibleContainers.Add((uid, spawnPoint, container, xform)); + continue; + } + // If it's unset, then we allow it to be used for both roundstart and midround joins if (spawnPoint.SpawnType == SpawnPointType.Unset) { diff --git a/Resources/Prototypes/DeltaV/Entities/Structures/cryopod.yml b/Resources/Prototypes/DeltaV/Entities/Structures/cryopod.yml new file mode 100644 index 00000000000..cec45e30fcb --- /dev/null +++ b/Resources/Prototypes/DeltaV/Entities/Structures/cryopod.yml @@ -0,0 +1,9 @@ +- type: entity + parent: CryogenicSleepUnit + id: CryogenicSleepUnitSpawnerPrisoner + suffix: Spawner, Prisoner + components: + - type: ContainerSpawnPoint + containerId: storage + spawnType: Job + job: Prisoner