mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 07:33:34 +01:00
Merge pull request #367 from Markolie/master
Switch copytext and sanitize proc
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
var/input
|
||||
if(!message)
|
||||
input = copytext(sanitize(input(src,"Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
|
||||
input = sanitize(copytext(input(src,"Choose an emote to display.") as text|null,1,MAX_MESSAGE_LEN))
|
||||
else
|
||||
input = message
|
||||
if(input)
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
var/input
|
||||
if(!message)
|
||||
input = copytext(sanitize(input(src, "Choose an emote to display.") as text|null), 1, MAX_MESSAGE_LEN)
|
||||
input = sanitize(copytext(input(src, "Choose an emote to display.") as text|null, 1, MAX_MESSAGE_LEN))
|
||||
else
|
||||
input = message
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
m_type = 1
|
||||
|
||||
if ("custom")
|
||||
var/input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
|
||||
var/input = sanitize(copytext(input("Choose an emote to display.") as text|null,1,MAX_MESSAGE_LEN))
|
||||
if (!input)
|
||||
return
|
||||
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
|
||||
@@ -740,11 +740,11 @@
|
||||
set desc = "Sets a description which will be shown when someone examines you."
|
||||
set category = "IC"
|
||||
|
||||
pose = copytext(sanitize(input(usr, "This is [src]. \He is...", "Pose", null) as text), 1, MAX_MESSAGE_LEN)
|
||||
pose = sanitize(copytext(input(usr, "This is [src]. \He is...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
|
||||
|
||||
/mob/living/carbon/human/verb/set_flavor()
|
||||
set name = "Set Flavour Text"
|
||||
set desc = "Sets an extended description of your character's features."
|
||||
set category = "IC"
|
||||
|
||||
flavor_text = copytext(sanitize(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text), 1)
|
||||
flavor_text = sanitize(copytext(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text, 1))
|
||||
|
||||
@@ -853,7 +853,7 @@
|
||||
for (var/datum/data/record/R in data_core.security)
|
||||
if (R.fields["id"] == E.fields["id"])
|
||||
if(hasHUD(usr,"security"))
|
||||
var/t1 = copytext(sanitize(input("Add Comment:", "Sec. records", null, null) as message),1,MAX_MESSAGE_LEN)
|
||||
var/t1 = sanitize(copytext(input("Add Comment:", "Sec. records", null, null) as message,1,MAX_MESSAGE_LEN))
|
||||
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"security")) )
|
||||
return
|
||||
var/counter = 1
|
||||
@@ -985,7 +985,7 @@
|
||||
for (var/datum/data/record/R in data_core.medical)
|
||||
if (R.fields["id"] == E.fields["id"])
|
||||
if(hasHUD(usr,"medical"))
|
||||
var/t1 = copytext(sanitize(input("Add Comment:", "Med. records", null, null) as message),1,MAX_MESSAGE_LEN)
|
||||
var/t1 = sanitize(copytext(input("Add Comment:", "Med. records", null, null) as message,1,MAX_MESSAGE_LEN))
|
||||
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"medical")) )
|
||||
return
|
||||
var/counter = 1
|
||||
|
||||
@@ -803,7 +803,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
pet.colour = "[M.colour]"
|
||||
user <<"You feed the slime the potion, removing it's powers and calming it."
|
||||
del(M)
|
||||
var/newname = copytext(sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text),1,MAX_NAME_LEN)
|
||||
var/newname = sanitize(copytext(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text,1,MAX_NAME_LEN))
|
||||
|
||||
if (!newname)
|
||||
newname = "pet slime"
|
||||
@@ -834,7 +834,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
|
||||
pet.colour = "[M.colour]"
|
||||
user <<"You feed the slime the potion, removing it's powers and calming it."
|
||||
del(M)
|
||||
var/newname = copytext(sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text),1,MAX_NAME_LEN)
|
||||
var/newname = sanitize(copytext(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text,1,MAX_NAME_LEN))
|
||||
|
||||
if (!newname)
|
||||
newname = "pet slime"
|
||||
|
||||
@@ -64,32 +64,32 @@ var/datum/paiController/paiController // Global handler for pAI candidates
|
||||
if("name")
|
||||
t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text
|
||||
if(t)
|
||||
candidate.name = copytext(sanitize(t),1,MAX_NAME_LEN)
|
||||
candidate.name = sanitize(copytext(t,1,MAX_NAME_LEN))
|
||||
if("desc")
|
||||
t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message
|
||||
if(t)
|
||||
candidate.description = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
candidate.description = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
if("role")
|
||||
t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text
|
||||
if(t)
|
||||
candidate.role = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
candidate.role = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
if("ooc")
|
||||
t = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message
|
||||
if(t)
|
||||
candidate.comments = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
candidate.comments = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
if("save")
|
||||
candidate.savefile_save(usr)
|
||||
if("load")
|
||||
candidate.savefile_load(usr)
|
||||
//In case people have saved unsanitized stuff.
|
||||
if(candidate.name)
|
||||
candidate.name = copytext(sanitize(candidate.name),1,MAX_NAME_LEN)
|
||||
candidate.name = sanitize(copytext(candidate.name,1,MAX_NAME_LEN))
|
||||
if(candidate.description)
|
||||
candidate.description = copytext(sanitize(candidate.description),1,MAX_MESSAGE_LEN)
|
||||
candidate.description = sanitize(copytext(candidate.description,1,MAX_MESSAGE_LEN))
|
||||
if(candidate.role)
|
||||
candidate.role = copytext(sanitize(candidate.role),1,MAX_MESSAGE_LEN)
|
||||
candidate.role = sanitize(copytext(candidate.role,1,MAX_MESSAGE_LEN))
|
||||
if(candidate.comments)
|
||||
candidate.comments = copytext(sanitize(candidate.comments),1,MAX_MESSAGE_LEN)
|
||||
candidate.comments = sanitize(copytext(candidate.comments,1,MAX_MESSAGE_LEN))
|
||||
|
||||
if("submit")
|
||||
if(candidate)
|
||||
|
||||
@@ -361,7 +361,7 @@
|
||||
|
||||
spawn(0)
|
||||
var/newname
|
||||
newname = copytext(sanitize(input(src,"You are a robot. Enter a name, or leave blank for the default name.", "Name change","") as text),1,MAX_NAME_LEN)
|
||||
newname = sanitize(copytext(input(src,"You are a robot. Enter a name, or leave blank for the default name.", "Name change","") as text,1,MAX_NAME_LEN))
|
||||
if (newname != "")
|
||||
notify_ai(3, name, newname)
|
||||
custom_name = newname
|
||||
|
||||
@@ -282,14 +282,14 @@
|
||||
set desc = "Sets a description which will be shown when someone examines you."
|
||||
set category = "IC"
|
||||
|
||||
pose = copytext(sanitize(input(usr, "This is [src]. It is...", "Pose", null) as text), 1, MAX_MESSAGE_LEN)
|
||||
pose = sanitize(copytext(input(usr, "This is [src]. It is...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
|
||||
|
||||
/mob/living/silicon/verb/set_flavor()
|
||||
set name = "Set Flavour Text"
|
||||
set desc = "Sets an extended description of your character's features."
|
||||
set category = "IC"
|
||||
|
||||
flavor_text = copytext(sanitize(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text), 1)
|
||||
flavor_text = sanitize(copytext(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text, 1))
|
||||
|
||||
/mob/living/silicon/binarycheck()
|
||||
return 1
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
return
|
||||
|
||||
if(istype(src.loc,/mob/living/simple_animal/borer))
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(sanitize(copytext(message, 1, MAX_MESSAGE_LEN)))
|
||||
if (!message)
|
||||
return
|
||||
log_say("[key_name(src)] : [message]")
|
||||
|
||||
@@ -278,7 +278,7 @@ proc/slur(phrase)
|
||||
n_letter = text("[n_letter]-[n_letter]")
|
||||
t = text("[t][n_letter]")//since the above is ran through for each letter, the text just adds up back to the original word.
|
||||
p++//for each letter p is increased to find where the next letter will be.
|
||||
return copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
return sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
|
||||
|
||||
proc/Gibberish(t, p)//t is the inputted message, and any value higher than 70 for p will cause letters to be replaced instead of added
|
||||
@@ -325,7 +325,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
|
||||
n_letter = text("[n_letter]")
|
||||
t = text("[t][n_letter]")
|
||||
p=p+n_mod
|
||||
return copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
return sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
|
||||
|
||||
/proc/shake_camera(mob/M, duration, strength=1)
|
||||
|
||||
Reference in New Issue
Block a user