Merge pull request #11946 from Heroman3003/hearfix

Fixes vertical noise spread penetrating floors
This commit is contained in:
Casey
2021-12-02 15:13:38 -05:00
committed by Chompstation Bot
parent 5043070c9d
commit c6d3fc59a5

View File

@@ -262,13 +262,13 @@ var/mobs_radio_range_fired = 1 //CHOMPEdit
/mob/living/silicon/robot/can_hear_radio(var/list/hearturfs)
var/turf/T = get_turf(src)
var/obj/item/device/radio/borg/R = hearturfs[T] // this should be an assoc list of turf-to-radio
// We heard it on our own radio? We use power for that.
if(istype(R) && R.myborg == src)
var/datum/robot_component/CO = get_component("radio")
if(!CO || !is_component_functioning("radio") || !cell_use_power(CO.active_usage))
return FALSE // Sorry, couldn't hear
return R // radio, true, false, what's the difference
/mob/observer/dead/can_hear_radio(var/list/hearturfs)
@@ -285,14 +285,17 @@ var/mobs_radio_range_fired = 1 //CHOMPEdit
var/list/hear = dview(range,T,INVISIBILITY_MAXIMUM)
var/list/hearturfs = list()
// Openspace visibility handling
// Below turfs we can see
for(var/turf/simulated/open/O in hear)
var/turf/U = GetBelow(O)
while(istype(U))
hearturfs |= U
U = GetBelow(U)
if(isopenspace(U))
U = GetBelow(U)
else
U = null
// Above us
var/above_range = range