Fix: Subspace broadcast filters non-radio devices (#22539)

* Please describe the intent of your changes in a clear fashion.
Addresses an `undefined variable` error (`canhear_range`) occurring in
`/proc/get_hearers_in_radio_ranges` when an
`/obj/item/implant/explosive` was present in the list of devices.

The root cause was identified in the `TRANSMISSION_SUBSPACE` path of
`/datum/signal/subspace/vocal/broadcast()`. Previously, this path would
copy all devices registered under `RADIO_CHAT` (which included the
explosive implant) into the `radios` list. Although a subsequent loop
attempted to filter out non-receivable devices, it would skip processing
non-`/obj/item/radio` types but not remove them from the list. This
meant the explosive implant, lacking a `canhear_range` variable, was
still passed to `get_hearers_in_radio_ranges`, causing the crash when
`radio.canhear_range` was accessed.

The fix modifies the `TRANSMISSION_SUBSPACE` logic to explicitly build
the `radios` list by iterating through `SSradio.get_devices` and only
adding actual `/obj/item/radio` instances that are capable of receiving
the signal. This ensures that `get_hearers_in_radio_ranges` only
receives valid radio objects, preventing the `canhear_range` error and
preserving the `as anything` keyword in the helper proc as it will now
always receive a correctly typed list.
* Please make sure that, in the case of mapping changes, you include
images of these changes in the PR's description.
* Please make sure to mark your PR as wip or review required by making a
comment with !wip or !review required
* If you include sprites/sounds/... (assets) that you have not created
yourself specify the license and original author below.
* Ensure that you also credit them in the appropriate location /
changelog as specified in the contributor guidelines

### Asset Licenses
The following assets that **have not** been created by myself are
included in this PR:

| Path | Original Author | License |
| --- | --- | --- |
| icons/example.dmi | ExamplePerson (Example Station) | CC0 |

Fixes SERVER-PROD-SR

---------

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
This commit is contained in:
sentry[bot]
2026-06-01 10:34:44 +00:00
committed by GitHub
co-authored by sentry[bot] <39604003+sentry[bot]@users.noreply.github.com> VMSolidus
parent 5a6fd09549
commit 879296835e
2 changed files with 7 additions and 5 deletions
@@ -151,11 +151,9 @@
if (TRANSMISSION_SUBSPACE)
// Reach any radios on the levels
var/list/all_radios_of_our_frequency = SSradio.get_devices(frequency, RADIO_CHAT)
radios = all_radios_of_our_frequency.Copy()
for (var/obj/item/radio/subspace_radio in radios)
if(!subspace_radio.can_receive(frequency, signal_reaches_every_z_level))
radios -= subspace_radio
for (var/obj/item/radio/subspace_radio in all_radios_of_our_frequency)
if(subspace_radio.can_receive(frequency, signal_reaches_every_z_level))
radios += subspace_radio
// Cool antag radios can hear all Horizon comms
for (var/antag_freq in list(SYND_FREQ, RAID_FREQ, NINJ_FREQ))