using Content.Server.Decals;
+using Content.Server.Ghost.Roles.Components;
using Content.Server.Shuttles.Events;
using Content.Shared.Decals;
using Content.Shared.Parallax.Biomes;
#region Load
+ /// <summary>
+ /// Loads all of the chunks for a particular biome, as well as handle any marker chunks.
+ /// </summary>
private void LoadChunks(
BiomeComponent component,
EntityUid gridUid,
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<GhostTakeoverAvailableComponent>(uid);
+ RemComp<GhostRoleComponent>(uid);
+ EntityManager.InitializeAndStartEntity(uid);
}
break;
}
}
+ /// <summary>
+ /// Loads a particular queued chunk for a biome.
+ /// </summary>
private void LoadChunk(
BiomeComponent component,
EntityUid gridUid,
#region Unload
+ /// <summary>
+ /// Handles all of the queued chunk unloads for a particular biome.
+ /// </summary>
private void UnloadChunks(BiomeComponent component, EntityUid gridUid, MapGridComponent grid, FastNoiseLite noise)
{
var active = _activeChunks[component];
}
}
+ /// <summary>
+ /// Unloads a specific biome chunk.
+ /// </summary>
private void UnloadChunk(BiomeComponent component, EntityUid gridUid, MapGridComponent grid, Vector2i chunk, FastNoiseLite noise, List<(Vector2i, Tile)> tiles)
{
// Reverse order to loading
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;
foreach (var entry in EntitySpawnCollection.GetSpawns(mobGroup.Entries, random))
{
- _entManager.SpawnEntity(entry, spawnPosition);
+ var uid = _entManager.CreateEntityUninitialized(entry, spawnPosition);
+ _entManager.RemoveComponent<GhostTakeoverAvailableComponent>(uid);
+ _entManager.RemoveComponent<GhostRoleComponent>(uid);
+ _entManager.InitializeAndStartEntity(uid);
}
await SuspendIfOutOfTime();