From 7ed34fe35624ab21cee4df3bc10a5195f45a1eff Mon Sep 17 00:00:00 2001 From: "rastaf.zero@gmail.com" Date: Wed, 23 Mar 2011 14:32:13 +0000 Subject: [PATCH] Rechecked organs.dm so code compiles now. Mobs in lockers now can hear radios. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1247 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/objects/items/helper_procs.dm | 2 +- code/game/objects/radio/intercom.dm | 19 +++++++++++++++++-- code/game/objects/radio/radio.dm | 23 ++++++++++++++--------- code/modules/mob/living/say.dm | 11 +++++++++-- tgstation.dme | 1 + 5 files changed, 42 insertions(+), 14 deletions(-) diff --git a/code/game/objects/items/helper_procs.dm b/code/game/objects/items/helper_procs.dm index c3d85aef249..c06f46cb1aa 100644 --- a/code/game/objects/items/helper_procs.dm +++ b/code/game/objects/items/helper_procs.dm @@ -121,4 +121,4 @@ var/global/list/common_tools = list( /proc/iscrowbar(O) if(O && istype(O, /obj/item/weapon/crowbar)) return 1 - return 0 \ No newline at end of file + return 0 diff --git a/code/game/objects/radio/intercom.dm b/code/game/objects/radio/intercom.dm index 04f86f44889..8eb67749e0f 100644 --- a/code/game/objects/radio/intercom.dm +++ b/code/game/objects/radio/intercom.dm @@ -15,8 +15,23 @@ /obj/item/device/radio/intercom/send_hear() if (!(src.wires & WIRE_RECEIVE)) return - if (src.listening) - return hearers(7, src.loc) + if (!src.listening) + return + + var/turf/T = get_turf(src) + var/list/hear = hearers(7, T) + var/list/V + //find mobs in lockers, cryo and intellycards + for (var/mob/M in world) + if (isturf(M.loc)) + continue //if M can hear us it is already was found by hearers() + if (!M.client) + continue //skip monkeys and leavers + if (!V) //lasy initialisation + V = view(7, T) + if (get_turf(M) in V) //this slow, but I don't think we'd have a lot of wardrobewhores every round --rastaf0 + hear+=M + return hear /obj/item/device/radio/intercom/hear_talk(mob/M as mob, msg) if(!src.anyai && !(M in src.ai)) diff --git a/code/game/objects/radio/radio.dm b/code/game/objects/radio/radio.dm index 9ecaab8830d..748b6063ba5 100644 --- a/code/game/objects/radio/radio.dm +++ b/code/game/objects/radio/radio.dm @@ -187,9 +187,7 @@ Speaker: [li //for (var/obj/item/device/radio/R in radio_connection.devices) for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"]) // Modified for security headset code -- TLE //if(R.accept_rad(src, message)) - for (var/i in R.send_hear(display_freq)) - if (!(i in receive)) - receive += i + receive |= R.send_hear(display_freq) //world << "DEBUG: receive.len=[receive.len]" var/list/heard_masked = list() // masked name or no real name @@ -294,13 +292,20 @@ Speaker: [li break if (!accept) return - var/list/hear = hearers(1, src.loc) - // modified so that a mob holding the radio is always a hearer of it - // this fixes radio problems when inside something (e.g. mulebot) - if(ismob(loc)) - if(! (loc in hear) ) - hear += loc + var/turf/T = get_turf(src) + var/list/hear = hearers(1, T) + var/list/V + //find mobs in lockers, cryo and intellycards + for (var/mob/M in world) + if (isturf(M.loc)) + continue //if M can hear us it is already was found by hearers() + if (!M.client) + continue //skip monkeys and leavers + if (!V) //lasy initialisation + V = view(1, T) + if (get_turf(M) in V) //this slow, but I don't think we'd have a lot of wardrobewhores every round --rastaf0 + hear+=M return hear /obj/item/device/radio/examine() diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index b71513cfbc5..aa2e7c79db9 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -141,11 +141,12 @@ for(var/i=0,i