Skip to content

Commit

Permalink
Add prisoner latejoin cryopod (#751)
Browse files Browse the repository at this point in the history
  • Loading branch information
DebugOk committed Jan 31, 2024
1 parent c463da2 commit 2d03cc6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Content.Server/Spawners/EntitySystems/ContainerSpawnPointSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ContainerSpawnPointComponent, ContainerManagerComponent, TransformComponent>();
Expand All @@ -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)
{
Expand Down
9 changes: 9 additions & 0 deletions Resources/Prototypes/DeltaV/Entities/Structures/cryopod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- type: entity
parent: CryogenicSleepUnit
id: CryogenicSleepUnitSpawnerPrisoner
suffix: Spawner, Prisoner
components:
- type: ContainerSpawnPoint
containerId: storage
spawnType: Job
job: Prisoner

0 comments on commit 2d03cc6

Please sign in to comment.