Skip to content

Commit

Permalink
fix Centcomm spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinary1 committed Jul 18, 2024
1 parent 4a4358c commit 9f89831
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions Content.Server/_Sunrise/StationCentcomm/StationCentcommSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,25 @@ private void AddCentcomm(StationCentCommComponent component)
var mapId = _mapManager.CreateMap();
_mapManager.AddUninitializedMap(mapId);
component.MapId = mapId;

if (_prototypeManager.TryIndex<GameMapPrototype>(component.Station, out var gameMap))
if (component.Station != null)
{
_gameTicker.LoadGameMap(gameMap, mapId, null);

if (_shuttle.TryAddFTLDestination(mapId, true, out var ftlDestination))
ftlDestination.Whitelist = component.ShuttleWhitelist;

_map.InitializeMap(mapId);
if (_prototypeManager.TryIndex<GameMapPrototype>(component.Station, out var gameMap))
{
_gameTicker.LoadGameMap(gameMap, mapId, null);

if (_shuttle.TryAddFTLDestination(mapId, true, out var ftlDestination))
ftlDestination.Whitelist = component.ShuttleWhitelist;

_map.InitializeMap(mapId);
}
else
{
_sawmill.Warning("No Centcomm map found, skipping setup.");
}
}
else
{
_sawmill.Warning("No Centcomm map found, skipping setup.");
_sawmill.Error("Component.Station is null, cannot proceed with Centcomm setup.");
}
}
}

0 comments on commit 9f89831

Please sign in to comment.