Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace obsolete code in shuttle systems. #31408

Merged
merged 9 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions Content.Server/Shuttles/Systems/ArrivalsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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!;
Expand Down Expand Up @@ -496,9 +496,7 @@ private void OnRoundStarting(RoundStartingEvent ev)

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))
{
Expand All @@ -524,7 +522,7 @@ private void SetupArrivalsStation()
AddComp(mapUid, restricted);
}

_mapManager.DoMapInitialize(mapId);
_mapSystem.InitializeMap(mapId);

// Handle roundstart stations.
var query = AllEntityQuery<StationArrivalsComponent>();
Expand Down Expand Up @@ -582,10 +580,10 @@ private void SetupShuttle(EntityUid uid, StationArrivalsComponent component)
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);
Expand All @@ -597,7 +595,7 @@ private void SetupShuttle(EntityUid uid, StationArrivalsComponent component)
}

// 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;
}
}
Loading
Loading