Skip to content
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
1 change: 0 additions & 1 deletion Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public sealed class PostMapInitTest

private static readonly string[] Grids =
{
"/Maps/CentralCommand/main.yml",
/// "/Maps/CentralCommand/harmony.yml", // Harmony CC version, WWDP edit, no more CentCom rotation
AdminTestArenaSystem.ArenaMapPath,
};
Expand Down
46 changes: 30 additions & 16 deletions Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -550,41 +550,55 @@ private void AddSingleCentcomm(EntityUid station, StationCentcommComponent compo
return;
}

var map = _mapSystem.CreateMap(out var mapId);
if (!_loader.TryLoadGrid(mapId, mapPath, out var grid))
if (!_loader.TryLoadMap(mapPath, out var map, out var grids))
{
Log.Error($"Failed to set up centcomm grid!");
Log.Error($"Failed to set up centcomm map from {mapPath}!");
return;
}

if (map is null || grids is null || grids.Count == 0)
{
Log.Error($"Centcomm map {mapPath} did not contain any grids.");
if (map != null)
QueueDel(map.Value.Owner);
return;
}

if (!Exists(map))
if (grids.Count > 1)
{
Log.Warning($"Centcomm map {mapPath} contained multiple grids; using the first one.");
}

var grid = grids.First();
if (!Exists(map.Value.Owner))
{
Log.Error($"Failed to set up centcomm map!");
QueueDel(grid);
return;
}

if (!Exists(grid))
if (!Exists(grid.Owner))
{
Log.Error($"Failed to set up centcomm grid!");
QueueDel(map);
QueueDel(map.Value.Owner);
return;
}

var xform = Transform(grid.Value);
if (xform.ParentUid != map || xform.MapUid != map)
var xform = Transform(grid.Owner);
if (xform.ParentUid != map.Value.Owner || xform.MapUid != map.Value.Owner)
{
Log.Error($"Centcomm grid is not parented to its own map?");
QueueDel(map);
QueueDel(grid);
QueueDel(map.Value.Owner);
QueueDel(grid.Owner);
return;
}

component.MapEntity = map;
_metaData.SetEntityName(map, Loc.GetString("map-name-centcomm"));
component.Entity = grid;
_shuttle.TryAddFTLDestination(mapId, true, out _);
Log.Info($"Created centcomm grid {ToPrettyString(grid)} on map {ToPrettyString(map)} for station {ToPrettyString(station)}");
_mapSystem.InitializeMap(map.Value.Comp.MapId);

component.MapEntity = map.Value.Owner;
_metaData.SetEntityName(map.Value.Owner, Loc.GetString("map-name-centcomm"));
component.Entity = grid.Owner;
_shuttle.TryAddFTLDestination(map.Value.Comp.MapId, true, out _);
Log.Info($"Created centcomm grid {ToPrettyString(grid)} on map {ToPrettyString(map.Value.Owner)} for station {ToPrettyString(station)}");
}

public HashSet<EntityUid> GetCentcommMaps()
Expand Down
25 changes: 19 additions & 6 deletions Resources/Maps/CentralCommand/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
meta:
format: 7
category: Grid
category: Map
engineVersion: 260.2.0
forkId: ""
forkVersion: ""
time: 08/02/2025 19:00:26
entityCount: 6947
maps: []
entityCount: 6948
maps:
- 8000
grids:
- 1668
orphans:
- 1668
orphans: []
nullspace: []
tilemap:
0: Space
Expand All @@ -34,12 +34,25 @@ tilemap:
entities:
- proto: ""
entities:
- uid: 8000
components:
- type: MetaData
name: Central Command Map
- type: Transform
- type: Map
mapPaused: True
- type: PhysicsMap
- type: GridTree
- type: MovedGrids
- type: Broadphase
- type: OccluderTree
- type: LoadedMap
- uid: 1668
components:
- type: MetaData
name: Central Command
- type: Transform
parent: invalid
parent: 8000
- type: MapGrid
chunks:
-1,-1:
Expand Down
1 change: 0 additions & 1 deletion Resources/Prototypes/Maps/CentralCommand/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
- type: gameMap
id: CentCommMain
isGrid: true # Did you know that centcomm is the only "game map" that isn't actually a map? Send help.
mapName: 'Central Command'
mapPath: /Maps/CentralCommand/main.yml
minPlayers: 0
Expand Down
Loading