Prevent people from abusing certain aspects of the game by keeping alert prompts open (#21914)

This commit is contained in:
Pieter Vlasblom
2016-12-04 18:30:34 +01:00
committed by AnturK
parent deb718e876
commit 2da5d58156
6 changed files with 18 additions and 17 deletions
+9 -8
View File
@@ -8,14 +8,23 @@
if(!mob)
return
if(IsGuestKey(key))
src << "Guests may not use OOC."
return
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
var/raw_msg = msg
if(!msg)
return
msg = emoji_parse(msg)
if((copytext(msg, 1, 2) in list(".",";",":","#")) || (findtext(lowertext(copytext(msg, 1, 5)), "say")))
if(alert("Your message \"[raw_msg]\" looks like it was meant for in game communication, say it in OOC?", "Meant for OOC?", "No", "Yes") != "Yes")
return
if(!(prefs.chat_toggles & CHAT_OOC))
src << "<span class='danger'>You have OOC muted.</span>"
return
@@ -42,14 +51,6 @@
message_admins("[key_name_admin(src)] has attempted to advertise in OOC: [msg]")
return
var/raw_msg = msg
msg = emoji_parse(msg)
if((copytext(msg, 1, 2) in list(".",";",":","#")) || (findtext(lowertext(copytext(msg, 1, 5)), "say")))
if(alert("Your message \"[raw_msg]\" looks like it was meant for in game communication, say it in OOC?", "Meant for OOC?", "No", "Yes") != "Yes")
return
log_ooc("[mob.name]/[key] : [raw_msg]")
var/keyname = key