mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-12 08:27:13 +01:00
088a71aacd
Fixes https://github.com/Aurorastation/Aurora.3/issues/14594 Fixes https://github.com/Aurorastation/Aurora.3/issues/19524 Fixes https://github.com/Aurorastation/Aurora.3/issues/19525 Fixes https://github.com/Aurorastation/Aurora.3/issues/19554 Fixes https://github.com/Aurorastation/Aurora.3/issues/19565 Fixes https://github.com/Aurorastation/Aurora.3/issues/19669 Fixes https://github.com/Aurorastation/Aurora.3/issues/19739 Fixes https://github.com/Aurorastation/Aurora.3/issues/19751 Fixes https://github.com/Aurorastation/Aurora.3/issues/20323 Fixes https://github.com/Aurorastation/Aurora.3/issues/20530 Fixes https://github.com/Aurorastation/Aurora.3/issues/21008 Fixes https://github.com/Aurorastation/Aurora.3/issues/21370 Fixes https://github.com/Aurorastation/Aurora.3/issues/21375 Fixes https://github.com/Aurorastation/Aurora.3/issues/21438 Fixes https://github.com/Aurorastation/Aurora.3/issues/21456 changes: - balance: "Budget insulated gloves no longer able to be manually restocked in YouTool (random insulation coefficient reroll exploit)." - bugfix: "Replaces missing req_access values from D3 Medical Equipment Storage." - bugfix: "Emitters can be rotated again (alt-click lock toggling disabled)." - bugfix: "Lights no longer explode when toggled off and on." - bugfix: "Langchat images now pop up for untranslated speech." - bugfix: "Cyborgs can no longer flip Plasteel Barricades remotely." - bugfix: "Fixes ghost vision inconsistently toggling when Following mobs." - bugfix: "Removes deprecated 'Gender and Pronouns' section from Appearance Changer (has been replaced by 'Pronouns' section)." - bugfix: "Offship locations will not print Mining Yield Declarations saying they're from SCCV Horizon." - bugfix: "Simple mobs which target their surroundings (destroying tables windows etc) will not do so if inside a container." - bugfix: "Newscaster Announcements channel now logs announcements made by heads of staff." - bugfix: "Held phoron- or chlorine-contaminated items will respect if you're wearing a sealed suit or thick gloves (that is to say, if the gloves provide fire protection)." - bugfix: "Fixes runtime in Electrical Storm event." - bugfix: "Fixes some bounties returning 0 credit reward due to rounding issues." - bugfix: "Removes old fusion debug vars, fixed outdated maths." - bugfix: "Fixes Horizon kitchen alt fridge being swapped w/ empty freezer." - bugfix: "Fixes chameleon projector sometimes turning user invisible." - bugfix: "You are again able to push an object currently being pulled." - bugfix: "Command Support roles which start with flash-protective sunglasses can now also choose them in their loadout." - code_imp: "Updates more code comments to DMDocs." - code_imp: "Corrects poison/venom for greimorian variable naming." - rscadd: "Adds missing fire alarm to Paramedic Quarters." - rscadd: "Holomap now respects and displays outer hull structure." --------- Signed-off-by: Batrachophreno <Batrochophreno@gmail.com>
60 lines
1.9 KiB
Plaintext
60 lines
1.9 KiB
Plaintext
/datum/radio_frequency
|
|
var/frequency as num
|
|
var/list/list/obj/devices = list()
|
|
|
|
/datum/radio_frequency/proc/post_signal(obj/source, datum/signal/signal, filter = null, range = null)
|
|
var/turf/start_point
|
|
if(range)
|
|
start_point = get_turf(source)
|
|
if(!start_point)
|
|
qdel(signal)
|
|
return 0
|
|
if (filter)
|
|
send_to_filter(source, signal, filter, start_point, range)
|
|
send_to_filter(source, signal, RADIO_DEFAULT, start_point, range)
|
|
else
|
|
//Broadcast the signal to everyone!
|
|
for (var/next_filter in devices)
|
|
send_to_filter(source, signal, next_filter, start_point, range)
|
|
|
|
/// Sends a signal to all machines belonging to a given filter. Should be called by post_signal()
|
|
/datum/radio_frequency/proc/send_to_filter(obj/source, datum/signal/signal, filter, turf/start_point = null, range = null)
|
|
if (range && !start_point)
|
|
return
|
|
|
|
for(var/obj/device in devices[filter])
|
|
if(device == source)
|
|
continue
|
|
if(range)
|
|
var/turf/end_point = get_turf(device)
|
|
if(!end_point)
|
|
continue
|
|
if(start_point.z != end_point.z || get_dist(start_point, end_point) > range)
|
|
continue
|
|
|
|
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
|
|
|
/datum/radio_frequency/proc/add_listener(obj/device, filter)
|
|
if (!filter)
|
|
filter = RADIO_DEFAULT
|
|
//LOG_DEBUG("add_listener(device=[device],filter=[filter]) frequency=[frequency]")
|
|
var/list/obj/devices_line = devices[filter]
|
|
if (!devices_line)
|
|
devices_line = new
|
|
devices[filter] = devices_line
|
|
devices_line |= device
|
|
// var/list/obj/devices_line___ = devices[filter_str]
|
|
// var/l = devices_line___.len
|
|
//LOG_DEBUG("DEBUG: devices_line.len=[devices_line.len]")
|
|
//LOG_DEBUG("DEBUG: devices(filter_str).len=[l]")
|
|
|
|
/datum/radio_frequency/proc/remove_listener(obj/device)
|
|
for (var/devices_filter in devices)
|
|
var/list/devices_line = devices[devices_filter]
|
|
devices_line-=device
|
|
while (null in devices_line)
|
|
devices_line -= null
|
|
if (devices_line.len==0)
|
|
devices -= devices_filter
|
|
del(devices_line)
|