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 GitHub
+7 -4
View File
@@ -249,13 +249,13 @@
/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)
@@ -272,14 +272,17 @@
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