]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Allow ghosts to hear radio message globally (#15078)
authoradamsong <adamsong@users.noreply.github.com>
Sun, 2 Apr 2023 23:56:07 +0000 (19:56 -0400)
committerGitHub <noreply@github.com>
Sun, 2 Apr 2023 23:56:07 +0000 (18:56 -0500)
Content.Server/Radio/Components/ActiveRadioComponent.cs
Content.Server/Radio/EntitySystems/RadioSystem.cs
Resources/Prototypes/Entities/Mobs/Player/observer.yml

index 881ce7a2fe6bd775df15dc101027015a973ee2e8..2c3ed9defa4e4ee09d7d5dbec4fe4954929e1bac 100644 (file)
@@ -14,4 +14,10 @@ public sealed class ActiveRadioComponent : Component
     /// </summary>
     [DataField("channels", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<RadioChannelPrototype>))]
     public HashSet<string> Channels = new();
+
+    /// <summary>
+    ///     If this radio can hear all messages on all maps
+    /// </summary>
+    [DataField("globalReceive")]
+    public bool GlobalReceive = false;
 }
index 15e439465e604e96d98d223a990607566bdd0e56..6557d5edef0f7d806f83427b06c69e40729e4e69 100644 (file)
@@ -90,14 +90,14 @@ public sealed class RadioSystem : EntitySystem
             if (!radio.Channels.Contains(channel.ID))
                 continue;
 
-            if (!channel.LongRange && transform.MapID != sourceMapId)
+            if (!channel.LongRange && transform.MapID != sourceMapId && !radio.GlobalReceive)
                 continue;
 
             // don't need telecom server for long range channels or handheld radios and intercoms
             var needServer = !channel.LongRange && (!hasMicro || !speakerQuery.HasComponent(receiver));
             if (needServer && !hasActiveServer)
                 continue;
-                
+
             // check if message can be sent to specific receiver
             var attemptEv = new RadioReceiveAttemptEvent(channel, radioSource, receiver);
             RaiseLocalEvent(ref attemptEv);
index 8ef363de41e4e2b8b884c6b257545d3c2331861f..1d4063743189f62d2c103f8b8a1b52dec82daada 100644 (file)
@@ -41,6 +41,7 @@
     - Service
     - Supply
     - Syndicate
+    globalReceive: true
   - type: Sprite
     overrideContainerOcclusion: true # Ghosts always show up regardless of where they're contained.
     netsync: false