Replace obsolete code in shuttle systems. (#31408)

* Format DockingSystem.Shuttle

* arrivals system

* docking system

* shuttle console system

* emergency shuttle system

* shuttle system

* thruster system

* Fix compile error

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
Mervill
2024-08-26 08:48:37 -07:00
committed by GitHub
parent 6c66e8fe1f
commit c6d291968f
12 changed files with 298 additions and 297 deletions

View File

@@ -45,10 +45,10 @@ public sealed class ArrivalsSystem : EntitySystem
[Dependency] private readonly IConfigurationManager _cfgManager = default!;
[Dependency] private readonly IConsoleHost _console = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IChatManager _chat = default!;
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
[Dependency] private readonly BiomeSystem _biomes = default!;
[Dependency] private readonly GameTicker _ticker = default!;
[Dependency] private readonly MapLoaderSystem _loader = default!;
@@ -496,9 +496,7 @@ public sealed class ArrivalsSystem : EntitySystem
private void SetupArrivalsStation()
{
var mapId = _mapManager.CreateMap();
var mapUid = _mapManager.GetMapEntityId(mapId);
_mapManager.AddUninitializedMap(mapId);
var mapUid = _mapSystem.CreateMap(out var mapId, false);
if (!_loader.TryLoad(mapId, _cfgManager.GetCVar(CCVars.ArrivalsMap), out var uids))
{
@@ -524,7 +522,7 @@ public sealed class ArrivalsSystem : EntitySystem
AddComp(mapUid, restricted);
}
_mapManager.DoMapInitialize(mapId);
_mapSystem.InitializeMap(mapId);
// Handle roundstart stations.
var query = AllEntityQuery<StationArrivalsComponent>();
@@ -582,10 +580,10 @@ public sealed class ArrivalsSystem : EntitySystem
return;
// Spawn arrivals on a dummy map then dock it to the source.
var dummyMap = _mapManager.CreateMap();
var dummpMapEntity = _mapSystem.CreateMap(out var dummyMapId);
if (TryGetArrivals(out var arrivals) &&
_loader.TryLoad(dummyMap, component.ShuttlePath.ToString(), out var shuttleUids))
_loader.TryLoad(dummyMapId, component.ShuttlePath.ToString(), out var shuttleUids))
{
component.Shuttle = shuttleUids[0];
var shuttleComp = Comp<ShuttleComponent>(component.Shuttle);
@@ -597,7 +595,7 @@ public sealed class ArrivalsSystem : EntitySystem
}
// Don't start the arrivals shuttle immediately docked so power has a time to stabilise?
var timer = AddComp<TimedDespawnComponent>(_mapManager.GetMapEntityId(dummyMap));
var timer = AddComp<TimedDespawnComponent>(dummpMapEntity);
timer.Lifetime = 15f;
}
}