mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
[MIRROR] Fixes a bug that made it so radios inside objects would blare out their comms to everyone around them (#29293)
* Fixes a bug that made it so radios inside objects would blare out their comms to everyone around them (#85676) ## About The Pull Request Currently things like bounty cubes that are not supposed to be broadcasting comms, are doing so for the department their nested radio is set to. This happens because when an encryption key is put into a radio that is off and that radio has its channels recalculated, all of the default channels on the encryption key (in the case of bounty cubes, supply) are set to being on and the radio 'forgets' that its supposed to be off until it is turned back on, then turned off again. Obviously we cannot do this to a radio inside of an object in game, as we have no way of accessing it, so I am adding a check for if the radio is off at the end of recalculatechannels() and if it is off, it will turn it on, then back off so it can remember ## Why It's Good For The Game fixes a rather minor bug which gives anyone free [insert comms channel here] for any object with a radio inside that is given an encryption key, my example being a bounty cube with a radio and an encryption key for cargo. This could also be solved by going through every single instance of a nested radio and taking away their keys and instead doing set_frequency(FREQ_<DEPARTMENT>) However, this would nip the bug in the bud when otherwise the way its been being written should be working. ## Changelog 🆑 fix: fixed nested radios with encryption keys giving free comms /🆑 --------- Co-authored-by: Odairu <39929315+Odairu@ users.noreply.github.com> * Fixes a bug that made it so radios inside objects would blare out their comms to everyone around them --------- Co-authored-by: Odairu <mdesisto510@gmail.com> Co-authored-by: Odairu <39929315+Odairu@ users.noreply.github.com>
This commit is contained in:
co-authored by
Odairu
Odairu
parent
284e6eef1a
commit
0e4966b6e0
@@ -159,6 +159,9 @@
|
||||
for(var/channel_name in channels)
|
||||
secure_radio_connections[channel_name] = add_radio(src, GLOB.radiochannels[channel_name])
|
||||
|
||||
if(!listening)
|
||||
remove_radio_all(src)
|
||||
|
||||
// Used for cyborg override
|
||||
/obj/item/radio/proc/resetChannels()
|
||||
channels = list()
|
||||
|
||||
Reference in New Issue
Block a user