From: ScarKy0 <106310278+ScarKy0@users.noreply.github.com> Date: Sun, 6 Apr 2025 12:10:17 +0000 (+0200) Subject: Allow Aghosts to load biomes. (#36325) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=9e299a10533af080f6888017bd1430ec0081dd03;p=space-station-14.git Allow Aghosts to load biomes. (#36325) * init * review --- diff --git a/Content.Server/Parallax/BiomeSystem.cs b/Content.Server/Parallax/BiomeSystem.cs index 89aa754850..dfa084c283 100644 --- a/Content.Server/Parallax/BiomeSystem.cs +++ b/Content.Server/Parallax/BiomeSystem.cs @@ -16,6 +16,7 @@ using Content.Shared.Light.Components; using Content.Shared.Parallax.Biomes; using Content.Shared.Parallax.Biomes.Layers; using Content.Shared.Parallax.Biomes.Markers; +using Content.Shared.Tag; using Microsoft.Extensions.ObjectPool; using Robust.Server.Player; using Robust.Shared; @@ -50,6 +51,7 @@ public sealed partial class BiomeSystem : SharedBiomeSystem [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly ShuttleSystem _shuttles = default!; + [Dependency] private readonly TagSystem _tags = default!; private EntityQuery _biomeQuery; private EntityQuery _fixturesQuery; @@ -59,6 +61,7 @@ public sealed partial class BiomeSystem : SharedBiomeSystem private readonly HashSet _handledEntities = new(); private const float DefaultLoadRange = 16f; private float _loadRange = DefaultLoadRange; + private static readonly ProtoId AllowBiomeLoadingTag = "AllowBiomeLoading"; private List<(Vector2i, Tile)> _tiles = new(); @@ -321,7 +324,7 @@ public sealed partial class BiomeSystem : SharedBiomeSystem private bool CanLoad(EntityUid uid) { - return !_ghostQuery.HasComp(uid); + return !_ghostQuery.HasComp(uid) || _tags.HasTag(uid, AllowBiomeLoadingTag); } public override void Update(float frameTime) diff --git a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml index e4ce500487..e964ae3b51 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml @@ -15,6 +15,7 @@ - NoConsoleSound - SilentStorageUser - PreventAccessLogging + - AllowBiomeLoading - type: Input context: "aghost" - type: Ghost diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index 8b2ae35873..be6746141d 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -15,6 +15,9 @@ - type: Tag id: AirSensor +- type: Tag + id: AllowBiomeLoading # Entities with this tag will load terrain, even if a ghost. + - type: Tag id: AllowGhostShownByEvent