Merge pull request #10546 from r4d6/loop-fix
Prevent Playback Devices from triggering Voice Analyzer
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user