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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user