From 9f898317a46636b01dc19489b54ad4842fb89eef Mon Sep 17 00:00:00 2001 From: Rinary Date: Thu, 18 Jul 2024 12:09:01 +0300 Subject: [PATCH] fix Centcomm spawn --- .../StationCentcomm/StationCentcommSystem.cs | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Content.Server/_Sunrise/StationCentcomm/StationCentcommSystem.cs b/Content.Server/_Sunrise/StationCentcomm/StationCentcommSystem.cs index 2576603c9d2..5a3e7050c69 100644 --- a/Content.Server/_Sunrise/StationCentcomm/StationCentcommSystem.cs +++ b/Content.Server/_Sunrise/StationCentcomm/StationCentcommSystem.cs @@ -65,19 +65,25 @@ private void AddCentcomm(StationCentCommComponent component) var mapId = _mapManager.CreateMap(); _mapManager.AddUninitializedMap(mapId); component.MapId = mapId; - - if (_prototypeManager.TryIndex(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(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."); } } }