]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remove Aghosts from "Warp to Most Followed" (#41448)
authorScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Sat, 15 Nov 2025 23:18:11 +0000 (00:18 +0100)
committerGitHub <noreply@github.com>
Sat, 15 Nov 2025 23:18:11 +0000 (23:18 +0000)
* init

* review

Content.Server/Ghost/GhostSystem.cs
Content.Shared/Follower/FollowerSystem.cs
Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml
Resources/Prototypes/tags.yml

index af1a433d1a30693b8466d4cc4695da5d2b84a7bc..3486e2024b3efb700fa733dd993e72da19607772 100644 (file)
@@ -333,7 +333,8 @@ namespace Content.Server.Ghost
             if (_followerSystem.GetMostGhostFollowed() is not {} target)
                 return;
 
-            WarpTo(uid, target);
+            // If there is a ghostnado happening you almost definitely wanna join it, so we automatically follow instead of just warping.
+            _followerSystem.StartFollowingEntity(uid, target);
         }
 
         private void WarpTo(EntityUid uid, EntityUid target)
index 07639a1790b3507c467a81f0122f1cc3cbbd17e8..8357b0106f1bf728dfa7a316e2981a0420f1412c 100644 (file)
@@ -35,6 +35,7 @@ public sealed class FollowerSystem : EntitySystem
     [Dependency] private readonly ISharedAdminManager _adminManager = default!;
 
     private static readonly ProtoId<TagPrototype> ForceableFollowTag = "ForceableFollow";
+    private static readonly ProtoId<TagPrototype> PreventGhostnadoWarpTag = "NotGhostnadoWarpable";
 
     public override void Initialize()
     {
@@ -320,11 +321,17 @@ public sealed class FollowerSystem : EntitySystem
         var query = EntityQueryEnumerator<FollowerComponent, GhostComponent, ActorComponent>();
         while (query.MoveNext(out _, out var follower, out _, out var actor))
         {
-            // Exclude admins
+            // Don't count admin followers so that players cannot notice if admins are in stealth mode and following someone.
             if (_adminManager.IsAdmin(actor.PlayerSession))
                 continue;
 
             var followed = follower.Following;
+
+            // If the followed entity cannot be ghostnado'd to, we don't count it.
+            // Used for making admins not warpable to, but IsAdmin isn't used for cases where the admin wants to be followed, for example during events.
+            if (_tagSystem.HasTag(followed, PreventGhostnadoWarpTag))
+                continue;
+
             // Add new entry or increment existing
             followedEnts.TryGetValue(followed, out var currentValue);
             followedEnts[followed] = currentValue + 1;
index 7c1bb7ef16e5814783346e90871906372c38ba33..e5fdfe7336ca97935668c0f70049b5174be8f753 100644 (file)
@@ -16,6 +16,7 @@
     - SilentStorageUser
     - PreventAccessLogging
     - AllowBiomeLoading
+    - NotGhostnadoWarpable
   - type: Input
     context: "aghost"
   - type: Ghost
index 3b3d11e612e1728ca34b849f71ea0890671fdfed..44b636495c4bd56b9feed51b1027bc6f5389d00d 100644 (file)
 
 - type: Tag
   id: Mouse # CargoBounty: BountyMouse
+
 - type: Tag
   id: Multitool # Storage whitelist: BaseClothingBeltEngineering. ItemMapper: BaseClothingBeltEngineering. ConstructionGraph: LogicGate
 
 - type: Tag
   id: NoConsoleSound # Blacklist on BaseComputer, StationMap. Tagged entity will not make sound when opening the UI.
 
+- type: Tag
+  id: NotGhostnadoWarpable # Prevents the entity from being selected via "Warp to most followed" ghost warp
+
 - type: Tag
   id: NozzleBackTank # Used by WeaponSprayNozzle to find a tagged entity for supplying ammo.