]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Allow Aghosts to load biomes. (#36325)
authorScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Sun, 6 Apr 2025 12:10:17 +0000 (14:10 +0200)
committerGitHub <noreply@github.com>
Sun, 6 Apr 2025 12:10:17 +0000 (14:10 +0200)
* init

* review

Content.Server/Parallax/BiomeSystem.cs
Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml
Resources/Prototypes/tags.yml

index 89aa7548506822715117ee38787b0eb7ddc519f6..dfa084c283099887ea6ca9c33bdea4ecff505f0b 100644 (file)
@@ -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<BiomeComponent> _biomeQuery;
     private EntityQuery<FixturesComponent> _fixturesQuery;
@@ -59,6 +61,7 @@ public sealed partial class BiomeSystem : SharedBiomeSystem
     private readonly HashSet<EntityUid> _handledEntities = new();
     private const float DefaultLoadRange = 16f;
     private float _loadRange = DefaultLoadRange;
+    private static readonly ProtoId<TagPrototype> 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)
index e4ce500487e593d061f6ac01e73db2ae8f69e07f..e964ae3b519d425d8cfde96bfa45b71f7911e97b 100644 (file)
@@ -15,6 +15,7 @@
     - NoConsoleSound
     - SilentStorageUser
     - PreventAccessLogging
+    - AllowBiomeLoading
   - type: Input
     context: "aghost"
   - type: Ghost
index 8b2ae35873e61a171a6e7f71fc1fc4a6a699670f..be6746141d812d6bfb2c4c95e443d3e269f17653 100644 (file)
@@ -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