mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge pull request #1530 from Datraen/NullSpeakCheck
Adds a check for can_speak to prevent null language procs being called.
This commit is contained in:
@@ -158,7 +158,12 @@
|
|||||||
|
|
||||||
// Can we speak this language, as opposed to just understanding it?
|
// Can we speak this language, as opposed to just understanding it?
|
||||||
/mob/proc/can_speak(datum/language/speaking)
|
/mob/proc/can_speak(datum/language/speaking)
|
||||||
return (speaking.can_speak_special(src) && (universal_speak || (speaking && speaking.flags & INNATE) || speaking in src.languages))
|
//Prevents someone from speaking a null language.
|
||||||
|
if(speaking)
|
||||||
|
return (speaking.can_speak_special(src) && (universal_speak || (speaking && (speaking.flags & INNATE)) || speaking in src.languages))
|
||||||
|
else
|
||||||
|
log_debug("[src] attempted to speak a null language.")
|
||||||
|
return 0
|
||||||
|
|
||||||
/mob/proc/get_language_prefix()
|
/mob/proc/get_language_prefix()
|
||||||
if(client && client.prefs.language_prefixes && client.prefs.language_prefixes.len)
|
if(client && client.prefs.language_prefixes && client.prefs.language_prefixes.len)
|
||||||
|
|||||||
Reference in New Issue
Block a user