Convenient Z-Levels (#421)

* clear ores and herbals frmo generation

* remake simple zlevels system

* GetMapOffset

* woohoo

* autolink between zlevels

* 5am

* somwthing sommetinh work

* Update CP14StationZLevelsSystem.cs

* fix biomespawner portal deletion

* some docs

* Revert "clear ores and herbals frmo generation"

This reverts commit 658d15a602.
This commit is contained in:
Ed
2024-08-25 19:53:15 +05:00
committed by GitHub
parent ea9c6ee7bf
commit 79515d9303
14 changed files with 264 additions and 71 deletions

View File

@@ -10,6 +10,7 @@ using Content.Server._CP14.BiomeSpawner.Components;
using Content.Server._CP14.RoundSeed;
using Content.Server.Decals;
using Content.Server.Parallax;
using Content.Shared.Whitelist;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
@@ -26,6 +27,7 @@ public sealed class CP14BiomeSpawnerSystem : EntitySystem
[Dependency] private readonly DecalSystem _decals = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly CP14RoundSeedSystem _roundSeed = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
public override void Initialize()
{
@@ -79,11 +81,12 @@ public sealed class CP14BiomeSpawnerSystem : EntitySystem
}
// Remove entities
var oldEntities = _lookup.GetEntitiesInRange(spawnerTransform.Coordinates, 0.48f);
var oldEntities = _lookup.GetEntitiesInRange(spawnerTransform.Coordinates, 0.48f, LookupFlags.Uncontained);
// TODO: Replace this shit with GetEntitiesInBox2
foreach (var entToRemove in oldEntities.Concat(new[] { ent.Owner })) // Do not remove self
{
QueueDel(entToRemove);
if (!_whitelist.IsValid(ent.Comp.DeleteBlacklist, entToRemove))
QueueDel(entToRemove);
}
if (_biome.TryGetEntity(vec, biome.Layers, tile.Value, seed, map, out var entityProto))