Merge pull request #5099 from tigercat2000/LOOK_MA_TWO_EARS

Saycode refactor/improvements
This commit is contained in:
TheDZD
2016-07-20 14:58:55 -04:00
committed by GitHub
12 changed files with 174 additions and 160 deletions
@@ -55,10 +55,12 @@
if(translate_binary)
var/datum/language/binary = all_languages["Robot Talk"]
binary.broadcast(M, message)
return RADIO_CONNECTION_NON_SUBSPACE
if(translate_hive)
var/datum/language/hivemind = all_languages["Hivemind"]
hivemind.broadcast(M, message)
return null
return RADIO_CONNECTION_NON_SUBSPACE
return RADIO_CONNECTION_FAIL
return ..()
+14 -7
View File
@@ -295,12 +295,14 @@ var/global/list/default_medbay_channels = list(
return secure_radio_connections[message_mode]
// If we were to send to a channel we don't have, drop it.
return null
return RADIO_CONNECTION_FAIL
/obj/item/device/radio/talk_into(mob/living/M as mob, message, channel, var/verb = "says", var/datum/language/speaking = null)
if(!on) return 0 // the device has to be on
if(!on)
return 0 // the device has to be on
// Fix for permacell radios, but kinda eh about actually fixing them.
if(!M || !message) return 0
if(!M || !message)
return 0
// Uncommenting this. To the above comment:
// The permacell radios aren't suppose to be able to transmit, this isn't a bug and this "fix" is just making radio wires useless. -Giacom
@@ -322,12 +324,17 @@ var/global/list/default_medbay_channels = list(
*/
//#### Grab the connection datum ####//
var/datum/radio_frequency/connection = handle_message_mode(M, message, channel)
if(!istype(connection))
return 0
if(!connection)
var/message_mode = handle_message_mode(M, message, channel)
switch(message_mode) //special cases
if(RADIO_CONNECTION_FAIL)
return 0
if(RADIO_CONNECTION_NON_SUBSPACE)
return 1
if(!istype(message_mode, /datum/radio_frequency)) //if not a special case, it should be returning a radio connection
return 0
var/datum/radio_frequency/connection = message_mode
var/turf/position = get_turf(src)
//#### Tagging the signal with all appropriate identity values ####//