Merge pull request #10546 from r4d6/loop-fix

Prevent Playback Devices from triggering Voice Analyzer
This commit is contained in:
Ghom
2020-01-13 01:26:05 +01:00
committed by GitHub
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -24,7 +24,7 @@
recorded = raw_message
listening = FALSE
languages = message_language
say("Activation message is '[recorded]'.", language = message_language)
say("The recorded message is '[recorded]'.", language = message_language)
/obj/item/assembly/playback/activate()
if(recorded == "") // Why say anything when there isn't anything to say
+4 -3
View File
@@ -34,9 +34,10 @@
if(listening && !radio_freq)
record_speech(speaker, raw_message, message_language)
else
if(message_language == languages) // If it isn't in the same language as the message, don't try to find the message
if(check_activation(speaker, raw_message))
addtimer(CALLBACK(src, .proc/pulse, 0), 10)
if(!istype(speaker, /obj/item/assembly/playback)) // Check if it isn't a playback device to prevent spam and lag
if(message_language == languages) // If it isn't in the same language as the message, don't try to find the message
if(check_activation(speaker, raw_message)) // Is it the message?
addtimer(CALLBACK(src, .proc/pulse, 0), 10)
/obj/item/assembly/voice/proc/record_speech(atom/movable/speaker, raw_message, datum/language/message_language)
languages = message_language // Assign the message's language to a variable to use it elsewhere