Uses get_turf(), so that messages can be heard while someone is holding the communicator.

This commit is contained in:
Neerti
2015-12-15 16:57:58 -05:00
parent 24903d073e
commit e73a809ade
@@ -550,7 +550,7 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
/obj/item/device/communicator/see_emote(mob/living/M, text)
var/rendered = "\icon[src] <span class='message'>[text]</span>"
for(var/obj/item/device/communicator/comm in communicating)
for(var/mob/mob in viewers(comm)) //We can't use visible_message(), or else we will get an infinite loop if two communicators hear each other.
for(var/mob/mob in viewers(get_turf(comm))) //We can't use visible_message(), or else we will get an infinite loop if two communicators hear each other.
mob.show_message(rendered)
..()
@@ -560,7 +560,7 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
// Description: Relays the speech to all linked communicators.
/obj/item/device/communicator/hear_talk(mob/living/M, text, verb, datum/language/speaking)
for(var/obj/item/device/communicator/comm in communicating)
for(var/mob/mob in viewers(comm))
for(var/mob/mob in viewers(get_turf(comm)))
//Can whoever is hearing us understand?
if(!mob.say_understands(M, speaking))
if(speaking)
@@ -580,12 +580,8 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
// Description: Relays the message to all linked communicators.
/obj/item/device/communicator/show_message(msg, type, alt, alt_type)
var/rendered = "\icon[src] <span class='message'>[msg]</span>"
for(var/mob/living/voice/voice in contents)
if(voice.client)
voice.show_message(rendered, type)
for(var/obj/item/device/communicator/comm in communicating)
// comm.audible_message(rendered)
for(var/mob/mob in hearers(comm)) //Ditto for audible messages.
for(var/mob/mob in hearers(get_turf(comm))) //Ditto for audible messages.
mob.show_message(rendered)
..()