From 9f143b006972e82aed3f97d6fe2dd90e2b35bfe6 Mon Sep 17 00:00:00 2001 From: FreeStylaLT Date: Tue, 7 Jan 2025 19:56:50 +0200 Subject: [PATCH] jesus christ get me out of saycode --- .../space_management/multiz_helpers.dm | 4 ++-- code/modules/mob/living/say.dm | 22 ++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/code/modules/mapping/space_management/multiz_helpers.dm b/code/modules/mapping/space_management/multiz_helpers.dm index 2c7a8114618..c92f1f2f52f 100644 --- a/code/modules/mapping/space_management/multiz_helpers.dm +++ b/code/modules/mapping/space_management/multiz_helpers.dm @@ -11,13 +11,13 @@ . = list(center_z) var/other_z = center_z var/offset - while((offset = SSmapping.multiz_levels[other_z]["[DOWN]"])) + while((offset = SSmapping.multiz_levels[other_z][Z_LEVEL_DOWN])) other_z -= offset if(other_z in .) break // no infinite loops . += other_z other_z = center_z - while((offset = SSmapping.multiz_levels[other_z]["[UP]"])) + while((offset = SSmapping.multiz_levels[other_z][Z_LEVEL_UP])) other_z += offset if(other_z in .) break // no infinite loops diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index cf4cedf1ee1..9decd23db9f 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -284,12 +284,20 @@ GLOBAL_LIST_INIT(department_radio_keys, list( var/static/list/eavesdropping_modes = list(MODE_WHISPER = TRUE, MODE_WHISPER_CRIT = TRUE) var/eavesdrop_range = 0 var/Zs_too = FALSE + var/listener_has_ceiling = TRUE + var/speaker_has_ceiling = TRUE + + var/turf/speaker_turf = get_turf(src) + var/ceiling_turf = GET_TURF_ABOVE(speaker_turf) + if(ceiling_turf) + if(istransparentturf(ceiling_turf)) + speaker_has_ceiling = FALSE if(eavesdropping_modes[message_mode]) eavesdrop_range = EAVESDROP_EXTRA_RANGE if(message_mode != MODE_WHISPER) + Zs_too = TRUE if(say_test(message) == "2") //CIT CHANGE - ditto message_range += 10 - Zs_too = TRUE // AZURE EDIT: thaumaturgical loudness (from orisons) if (has_status_effect(/datum/status_effect/thaumaturgy)) spans |= SPAN_REALLYBIG @@ -345,9 +353,21 @@ GLOBAL_LIST_INIT(department_radio_keys, list( var/rendered = compose_message(src, message_language, message, , spans, message_mode) for(var/_AM in listening) var/atom/movable/AM = _AM + var/turf/listener_turf = get_turf(_AM) + var/listener_ceiling = GET_TURF_ABOVE(listener_turf) + if(listener_ceiling) + if(istransparentturf(listener_ceiling)) + listener_has_ceiling = FALSE if(!Zs_too && !isobserver(AM)) if(AM.z != src.z) continue + if(Zs_too) + if(AM.z < src.z && listener_has_ceiling) //Listener is below the speaker and has a ceiling above them + continue + if(AM.z > src.z && speaker_has_ceiling) //Listener is above the speaker and the speaker has a ceiling above + continue + if(listener_has_ceiling && speaker_has_ceiling && AM.z != src.z) //Both have a ceiling, on different z-levels -- no hearing at all + continue if(eavesdrop_range && get_dist(source, AM) > message_range && !(the_dead[AM])) AM.Hear(eavesrendered, src, message_language, eavesdropping, , spans, message_mode, original_message) else