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;
if (_centcommMap != null)
if (_centComMap != null)
{
foreach (var comp in EntityQuery<StationDataComponent>(true))
{
if (!TryComp<ShuttleComponent>(comp.EmergencyShuttle, out var shuttle)) continue;
if (Deleted(_centcomm))
if (Deleted(_centCom))
{
// TODO: Need to get non-overlapping positions.
FTLTravel(shuttle,
new EntityCoordinates(
_mapManager.GetMapEntityId(_centcommMap.Value),
_mapManager.GetMapEntityId(_centComMap.Value),
Vector2.One * 1000f), _consoleAccumulator, TransitTime);
}
else
{
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);
// Guarantees that emergency shuttle arrives first before anyone else can FTL.
if (_centcomm != null)
AddFTLDestination(_centcomm.Value, true);
if (_centCom != null)
AddFTLDestination(_centCom.Value, true);
}
}

View File

@@ -38,8 +38,8 @@ public sealed partial class ShuttleSystem
[Dependency] private readonly DockingSystem _dockSystem = default!;
[Dependency] private readonly StationSystem _station = default!;
private MapId? _centcommMap;
private EntityUid? _centcomm;
private MapId? _centComMap;
private EntityUid? _centCom;
/// <summary>
/// Used for multiple shuttle spawn offsets.
@@ -367,8 +367,8 @@ public sealed partial class ShuttleSystem
_consoleAccumulator = _configManager.GetCVar(CCVars.EmergencyShuttleDockTime);
EmergencyShuttleArrived = true;
if (_centcommMap != null)
_mapManager.SetMapPaused(_centcommMap.Value, false);
if (_centComMap != null)
_mapManager.SetMapPaused(_centComMap.Value, false);
foreach (var comp in EntityQuery<StationDataComponent>(true))
{
@@ -415,21 +415,21 @@ public sealed partial class ShuttleSystem
private void SetupEmergencyShuttle()
{
if (!_emergencyShuttleEnabled || _centcommMap != null && _mapManager.MapExists(_centcommMap.Value)) return;
if (!_emergencyShuttleEnabled || _centComMap != null && _mapManager.MapExists(_centComMap.Value)) return;
_centcommMap = _mapManager.CreateMap();
_mapManager.SetMapPaused(_centcommMap.Value, true);
_centComMap = _mapManager.CreateMap();
_mapManager.SetMapPaused(_centComMap.Value, true);
// 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");
_centcomm = centcomm;
var (_, centcomm) = _loader.LoadBlueprint(_centComMap.Value, "/Maps/centcomm.yml");
_centCom = centcomm;
if (_centcomm != null)
AddFTLDestination(_centcomm.Value, false);
if (_centCom != null)
AddFTLDestination(_centCom.Value, false);
}
else
{
@@ -444,10 +444,10 @@ public sealed partial class ShuttleSystem
private void AddEmergencyShuttle(StationDataComponent component)
{
if (!_emergencyShuttleEnabled || _centcommMap == null || component.EmergencyShuttle != null) return;
if (!_emergencyShuttleEnabled || _centComMap == null || component.EmergencyShuttle != null) return;
// 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.
Offset = new Vector2(500f + _shuttleIndex, 0f)
@@ -473,13 +473,13 @@ public sealed partial class ShuttleSystem
_shuttleIndex = 0f;
if (_centcommMap == null || !_mapManager.MapExists(_centcommMap.Value))
if (_centComMap == null || !_mapManager.MapExists(_centComMap.Value))
{
_centcommMap = null;
_centComMap = null;
return;
}
_mapManager.DeleteMap(_centcommMap.Value);
_mapManager.DeleteMap(_centComMap.Value);
}
/// <summary>

View File

@@ -918,7 +918,7 @@ namespace Content.Shared.CCVar
CVarDef.Create("shuttle.recall_turning_point", 0.5f, CVar.SERVERONLY);
/// <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>
public static readonly CVarDef<string> CentcommMap =
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-hop = the head of personnel
job-supervisors-hop-qm = the quartermaster and head of personnel