Fix some more "CentCom" instances (#9970)

This commit is contained in:
Myctai
2022-07-26 14:00:38 +00:00
committed by GitHub
parent 47a5c98bd8
commit 43ec284318
4 changed files with 26 additions and 26 deletions

View File

@@ -123,24 +123,24 @@ public sealed partial class ShuttleSystem
{ {
_launchedShuttles = true; _launchedShuttles = true;
if (_centcommMap != null) if (_centComMap != null)
{ {
foreach (var comp in EntityQuery<StationDataComponent>(true)) foreach (var comp in EntityQuery<StationDataComponent>(true))
{ {
if (!TryComp<ShuttleComponent>(comp.EmergencyShuttle, out var shuttle)) continue; if (!TryComp<ShuttleComponent>(comp.EmergencyShuttle, out var shuttle)) continue;
if (Deleted(_centcomm)) if (Deleted(_centCom))
{ {
// TODO: Need to get non-overlapping positions. // TODO: Need to get non-overlapping positions.
FTLTravel(shuttle, FTLTravel(shuttle,
new EntityCoordinates( new EntityCoordinates(
_mapManager.GetMapEntityId(_centcommMap.Value), _mapManager.GetMapEntityId(_centComMap.Value),
Vector2.One * 1000f), _consoleAccumulator, TransitTime); Vector2.One * 1000f), _consoleAccumulator, TransitTime);
} }
else else
{ {
FTLTravel(shuttle, FTLTravel(shuttle,
_centcomm.Value, _consoleAccumulator, TransitTime, dock: true); _centCom.Value, _consoleAccumulator, TransitTime, dock: true);
} }
} }
} }
@@ -156,8 +156,8 @@ public sealed partial class ShuttleSystem
Timer.Spawn((int) (TransitTime * 1000) + _bufferTime.Milliseconds, () => _roundEnd.EndRound(), _roundEndCancelToken.Token); Timer.Spawn((int) (TransitTime * 1000) + _bufferTime.Milliseconds, () => _roundEnd.EndRound(), _roundEndCancelToken.Token);
// Guarantees that emergency shuttle arrives first before anyone else can FTL. // Guarantees that emergency shuttle arrives first before anyone else can FTL.
if (_centcomm != null) if (_centCom != null)
AddFTLDestination(_centcomm.Value, true); AddFTLDestination(_centCom.Value, true);
} }
} }

View File

@@ -38,8 +38,8 @@ public sealed partial class ShuttleSystem
[Dependency] private readonly DockingSystem _dockSystem = default!; [Dependency] private readonly DockingSystem _dockSystem = default!;
[Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly StationSystem _station = default!;
private MapId? _centcommMap; private MapId? _centComMap;
private EntityUid? _centcomm; private EntityUid? _centCom;
/// <summary> /// <summary>
/// Used for multiple shuttle spawn offsets. /// Used for multiple shuttle spawn offsets.
@@ -367,8 +367,8 @@ public sealed partial class ShuttleSystem
_consoleAccumulator = _configManager.GetCVar(CCVars.EmergencyShuttleDockTime); _consoleAccumulator = _configManager.GetCVar(CCVars.EmergencyShuttleDockTime);
EmergencyShuttleArrived = true; EmergencyShuttleArrived = true;
if (_centcommMap != null) if (_centComMap != null)
_mapManager.SetMapPaused(_centcommMap.Value, false); _mapManager.SetMapPaused(_centComMap.Value, false);
foreach (var comp in EntityQuery<StationDataComponent>(true)) foreach (var comp in EntityQuery<StationDataComponent>(true))
{ {
@@ -415,21 +415,21 @@ public sealed partial class ShuttleSystem
private void SetupEmergencyShuttle() private void SetupEmergencyShuttle()
{ {
if (!_emergencyShuttleEnabled || _centcommMap != null && _mapManager.MapExists(_centcommMap.Value)) return; if (!_emergencyShuttleEnabled || _centComMap != null && _mapManager.MapExists(_centComMap.Value)) return;
_centcommMap = _mapManager.CreateMap(); _centComMap = _mapManager.CreateMap();
_mapManager.SetMapPaused(_centcommMap.Value, true); _mapManager.SetMapPaused(_centComMap.Value, true);
// Load CentCom // Load CentCom
var centcommPath = _configManager.GetCVar(CCVars.CentcommMap); var centComPath = _configManager.GetCVar(CCVars.CentcommMap);
if (!string.IsNullOrEmpty(centcommPath)) if (!string.IsNullOrEmpty(centComPath))
{ {
var (_, centcomm) = _loader.LoadBlueprint(_centcommMap.Value, "/Maps/centcomm.yml"); var (_, centcomm) = _loader.LoadBlueprint(_centComMap.Value, "/Maps/centcomm.yml");
_centcomm = centcomm; _centCom = centcomm;
if (_centcomm != null) if (_centCom != null)
AddFTLDestination(_centcomm.Value, false); AddFTLDestination(_centCom.Value, false);
} }
else else
{ {
@@ -444,10 +444,10 @@ public sealed partial class ShuttleSystem
private void AddEmergencyShuttle(StationDataComponent component) private void AddEmergencyShuttle(StationDataComponent component)
{ {
if (!_emergencyShuttleEnabled || _centcommMap == null || component.EmergencyShuttle != null) return; if (!_emergencyShuttleEnabled || _centComMap == null || component.EmergencyShuttle != null) return;
// Load escape shuttle // Load escape shuttle
var (_, shuttle) = _loader.LoadBlueprint(_centcommMap.Value, component.EmergencyShuttlePath.ToString(), new MapLoadOptions() var (_, shuttle) = _loader.LoadBlueprint(_centComMap.Value, component.EmergencyShuttlePath.ToString(), new MapLoadOptions()
{ {
// Should be far enough... right? I'm too lazy to bounds check CentCom rn. // Should be far enough... right? I'm too lazy to bounds check CentCom rn.
Offset = new Vector2(500f + _shuttleIndex, 0f) Offset = new Vector2(500f + _shuttleIndex, 0f)
@@ -473,13 +473,13 @@ public sealed partial class ShuttleSystem
_shuttleIndex = 0f; _shuttleIndex = 0f;
if (_centcommMap == null || !_mapManager.MapExists(_centcommMap.Value)) if (_centComMap == null || !_mapManager.MapExists(_centComMap.Value))
{ {
_centcommMap = null; _centComMap = null;
return; return;
} }
_mapManager.DeleteMap(_centcommMap.Value); _mapManager.DeleteMap(_centComMap.Value);
} }
/// <summary> /// <summary>

View File

@@ -918,7 +918,7 @@ namespace Content.Shared.CCVar
CVarDef.Create("shuttle.recall_turning_point", 0.5f, CVar.SERVERONLY); CVarDef.Create("shuttle.recall_turning_point", 0.5f, CVar.SERVERONLY);
/// <summary> /// <summary>
/// The map to load for centcomm for the emergency shuttle to dock to. /// The map to load for CentCom for the emergency shuttle to dock to.
/// </summary> /// </summary>
public static readonly CVarDef<string> CentcommMap = public static readonly CVarDef<string> CentcommMap =
CVarDef.Create("shuttle.centcomm_map", "/Maps/centcomm.yml", CVar.SERVERONLY); CVarDef.Create("shuttle.centcomm_map", "/Maps/centcomm.yml", CVar.SERVERONLY);

View File

@@ -1,4 +1,4 @@
job-supervisors-centcom = centcom official job-supervisors-centcom = CentCom official
job-supervisors-captain = the captain job-supervisors-captain = the captain
job-supervisors-hop = the head of personnel job-supervisors-hop = the head of personnel
job-supervisors-hop-qm = the quartermaster and head of personnel job-supervisors-hop-qm = the quartermaster and head of personnel