Fixup playerspawn stuff (#31546)

* Fixup playerspawn stuff

- Also removed arrivals forcing, this should just turn containerspawnpoint off.

* fix this one

* test fix

* really fix
This commit is contained in:
metalgearsloth
2024-08-29 15:27:47 +10:00
committed by GitHub
parent 2fd57c2d4a
commit f0615ec3c8
6 changed files with 14 additions and 61 deletions

View File

@@ -11,6 +11,7 @@ using Content.Server.Screens.Components;
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Events;
using Content.Server.Spawners.Components;
using Content.Server.Spawners.EntitySystems;
using Content.Server.Station.Components;
using Content.Server.Station.Events;
using Content.Server.Station.Systems;
@@ -69,11 +70,6 @@ public sealed class ArrivalsSystem : EntitySystem
/// </summary>
public bool Enabled { get; private set; }
/// <summary>
/// Flags if all players must arrive via the Arrivals system, or if they can spawn in other ways.
/// </summary>
public bool Forced { get; private set; }
/// <summary>
/// Flags if all players spawning at the departure terminal have godmode until they leave the terminal.
/// </summary>
@@ -95,6 +91,8 @@ public sealed class ArrivalsSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<PlayerSpawningEvent>(HandlePlayerSpawning, before: new []{ typeof(ContainerSpawnPointSystem), typeof(SpawnPointSystem)});
SubscribeLocalEvent<StationArrivalsComponent, StationPostInitEvent>(OnStationPostInit);
SubscribeLocalEvent<ArrivalsShuttleComponent, ComponentStartup>(OnShuttleStartup);
@@ -112,11 +110,9 @@ public sealed class ArrivalsSystem : EntitySystem
// Don't invoke immediately as it will get set in the natural course of things.
Enabled = _cfgManager.GetCVar(CCVars.ArrivalsShuttles);
Forced = _cfgManager.GetCVar(CCVars.ForceArrivals);
ArrivalsGodmode = _cfgManager.GetCVar(CCVars.GodmodeArrivals);
_cfgManager.OnValueChanged(CCVars.ArrivalsShuttles, SetArrivals);
_cfgManager.OnValueChanged(CCVars.ForceArrivals, b => Forced = b);
_cfgManager.OnValueChanged(CCVars.GodmodeArrivals, b => ArrivalsGodmode = b);
// Command so admins can set these for funsies
@@ -339,7 +335,7 @@ public sealed class ArrivalsSystem : EntitySystem
return;
// Only works on latejoin even if enabled.
if (!Enabled || !Forced && _ticker.RunLevel != GameRunLevel.InRound)
if (!Enabled || _ticker.RunLevel != GameRunLevel.InRound)
return;
if (!HasComp<StationArrivalsComponent>(ev.Station))