Allow Aghosts to load biomes. (#36325)

* init

* review
This commit is contained in:
ScarKy0
2025-04-06 14:10:17 +02:00
committed by GitHub
parent 92c9653801
commit 9e299a1053
3 changed files with 8 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ using Content.Shared.Light.Components;
using Content.Shared.Parallax.Biomes; using Content.Shared.Parallax.Biomes;
using Content.Shared.Parallax.Biomes.Layers; using Content.Shared.Parallax.Biomes.Layers;
using Content.Shared.Parallax.Biomes.Markers; using Content.Shared.Parallax.Biomes.Markers;
using Content.Shared.Tag;
using Microsoft.Extensions.ObjectPool; using Microsoft.Extensions.ObjectPool;
using Robust.Server.Player; using Robust.Server.Player;
using Robust.Shared; using Robust.Shared;
@@ -50,6 +51,7 @@ public sealed partial class BiomeSystem : SharedBiomeSystem
[Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly ShuttleSystem _shuttles = default!; [Dependency] private readonly ShuttleSystem _shuttles = default!;
[Dependency] private readonly TagSystem _tags = default!;
private EntityQuery<BiomeComponent> _biomeQuery; private EntityQuery<BiomeComponent> _biomeQuery;
private EntityQuery<FixturesComponent> _fixturesQuery; private EntityQuery<FixturesComponent> _fixturesQuery;
@@ -59,6 +61,7 @@ public sealed partial class BiomeSystem : SharedBiomeSystem
private readonly HashSet<EntityUid> _handledEntities = new(); private readonly HashSet<EntityUid> _handledEntities = new();
private const float DefaultLoadRange = 16f; private const float DefaultLoadRange = 16f;
private float _loadRange = DefaultLoadRange; private float _loadRange = DefaultLoadRange;
private static readonly ProtoId<TagPrototype> AllowBiomeLoadingTag = "AllowBiomeLoading";
private List<(Vector2i, Tile)> _tiles = new(); private List<(Vector2i, Tile)> _tiles = new();
@@ -321,7 +324,7 @@ public sealed partial class BiomeSystem : SharedBiomeSystem
private bool CanLoad(EntityUid uid) private bool CanLoad(EntityUid uid)
{ {
return !_ghostQuery.HasComp(uid); return !_ghostQuery.HasComp(uid) || _tags.HasTag(uid, AllowBiomeLoadingTag);
} }
public override void Update(float frameTime) public override void Update(float frameTime)

View File

@@ -15,6 +15,7 @@
- NoConsoleSound - NoConsoleSound
- SilentStorageUser - SilentStorageUser
- PreventAccessLogging - PreventAccessLogging
- AllowBiomeLoading
- type: Input - type: Input
context: "aghost" context: "aghost"
- type: Ghost - type: Ghost

View File

@@ -15,6 +15,9 @@
- type: Tag - type: Tag
id: AirSensor id: AirSensor
- type: Tag
id: AllowBiomeLoading # Entities with this tag will load terrain, even if a ghost.
- type: Tag - type: Tag
id: AllowGhostShownByEvent id: AllowGhostShownByEvent