mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge pull request #11946 from Heroman3003/hearfix
Fixes vertical noise spread penetrating floors
This commit is contained in:
@@ -262,13 +262,13 @@ var/mobs_radio_range_fired = 1 //CHOMPEdit
|
|||||||
/mob/living/silicon/robot/can_hear_radio(var/list/hearturfs)
|
/mob/living/silicon/robot/can_hear_radio(var/list/hearturfs)
|
||||||
var/turf/T = get_turf(src)
|
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
|
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.
|
// We heard it on our own radio? We use power for that.
|
||||||
if(istype(R) && R.myborg == src)
|
if(istype(R) && R.myborg == src)
|
||||||
var/datum/robot_component/CO = get_component("radio")
|
var/datum/robot_component/CO = get_component("radio")
|
||||||
if(!CO || !is_component_functioning("radio") || !cell_use_power(CO.active_usage))
|
if(!CO || !is_component_functioning("radio") || !cell_use_power(CO.active_usage))
|
||||||
return FALSE // Sorry, couldn't hear
|
return FALSE // Sorry, couldn't hear
|
||||||
|
|
||||||
return R // radio, true, false, what's the difference
|
return R // radio, true, false, what's the difference
|
||||||
|
|
||||||
/mob/observer/dead/can_hear_radio(var/list/hearturfs)
|
/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/hear = dview(range,T,INVISIBILITY_MAXIMUM)
|
||||||
var/list/hearturfs = list()
|
var/list/hearturfs = list()
|
||||||
|
|
||||||
// Openspace visibility handling
|
// Openspace visibility handling
|
||||||
// Below turfs we can see
|
// Below turfs we can see
|
||||||
for(var/turf/simulated/open/O in hear)
|
for(var/turf/simulated/open/O in hear)
|
||||||
var/turf/U = GetBelow(O)
|
var/turf/U = GetBelow(O)
|
||||||
while(istype(U))
|
while(istype(U))
|
||||||
hearturfs |= U
|
hearturfs |= U
|
||||||
U = GetBelow(U)
|
if(isopenspace(U))
|
||||||
|
U = GetBelow(U)
|
||||||
|
else
|
||||||
|
U = null
|
||||||
|
|
||||||
// Above us
|
// Above us
|
||||||
var/above_range = range
|
var/above_range = range
|
||||||
|
|||||||
Reference in New Issue
Block a user