diff --git a/Content.Server/Parallax/BiomeSystem.cs b/Content.Server/Parallax/BiomeSystem.cs index 66a0a6cf22..a679ab2648 100644 --- a/Content.Server/Parallax/BiomeSystem.cs +++ b/Content.Server/Parallax/BiomeSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Decals; +using Content.Server.Ghost.Roles.Components; using Content.Server.Shuttles.Events; using Content.Shared.Decals; using Content.Shared.Parallax.Biomes; @@ -313,6 +314,9 @@ public sealed partial class BiomeSystem : SharedBiomeSystem #region Load + /// + /// Loads all of the chunks for a particular biome, as well as handle any marker chunks. + /// private void LoadChunks( BiomeComponent component, EntityUid gridUid, @@ -358,7 +362,13 @@ public sealed partial class BiomeSystem : SharedBiomeSystem for (var k = 0; k < layerProto.GroupCount; k++) { - Spawn(layerProto.Prototype, new EntityCoordinates(gridUid, point)); + // If it is a ghost role then purge it + // TODO: This is *kind* of a bandaid but natural mobs spawns needs a lot more work. + // Ideally we'd just have ghost role and non-ghost role variants for some stuff. + var uid = EntityManager.CreateEntityUninitialized(layerProto.Prototype, new EntityCoordinates(gridUid, point)); + RemComp(uid); + RemComp(uid); + EntityManager.InitializeAndStartEntity(uid); } break; @@ -381,6 +391,9 @@ public sealed partial class BiomeSystem : SharedBiomeSystem } } + /// + /// Loads a particular queued chunk for a biome. + /// private void LoadChunk( BiomeComponent component, EntityUid gridUid, @@ -494,6 +507,9 @@ public sealed partial class BiomeSystem : SharedBiomeSystem #region Unload + /// + /// Handles all of the queued chunk unloads for a particular biome. + /// private void UnloadChunks(BiomeComponent component, EntityUid gridUid, MapGridComponent grid, FastNoiseLite noise) { var active = _activeChunks[component]; @@ -510,6 +526,9 @@ public sealed partial class BiomeSystem : SharedBiomeSystem } } + /// + /// Unloads a specific biome chunk. + /// private void UnloadChunk(BiomeComponent component, EntityUid gridUid, MapGridComponent grid, Vector2i chunk, FastNoiseLite noise, List<(Vector2i, Tile)> tiles) { // Reverse order to loading diff --git a/Content.Server/Salvage/SpawnSalvageMissionJob.cs b/Content.Server/Salvage/SpawnSalvageMissionJob.cs index b7de8fac27..862e495614 100644 --- a/Content.Server/Salvage/SpawnSalvageMissionJob.cs +++ b/Content.Server/Salvage/SpawnSalvageMissionJob.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using Content.Server.Atmos; using Content.Server.Atmos.Components; using Content.Server.CPUJob.JobQueues; +using Content.Server.Ghost.Roles.Components; using Content.Server.Parallax; using Content.Server.Procedural; using Content.Server.Salvage.Expeditions; @@ -359,7 +360,10 @@ public sealed class SpawnSalvageMissionJob : Job foreach (var entry in EntitySpawnCollection.GetSpawns(mobGroup.Entries, random)) { - _entManager.SpawnEntity(entry, spawnPosition); + var uid = _entManager.CreateEntityUninitialized(entry, spawnPosition); + _entManager.RemoveComponent(uid); + _entManager.RemoveComponent(uid); + _entManager.InitializeAndStartEntity(uid); } await SuspendIfOutOfTime();