diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm
index 5aab3c5abc4..c162bf66724 100644
--- a/code/datums/datumvars.dm
+++ b/code/datums/datumvars.dm
@@ -415,7 +415,7 @@ client/Topic(href, href_list, hsrc)
//~CARN: for renaming mobs (updates their real_name and their ID/PDA if applicable).
else if (href_list["rename"])
- var/new_name = input(usr,"What would you like to name this mob?","Input a name") as text|null
+ var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name") as text|null),1,MAX_NAME_LEN)
if(!new_name) return
var/mob/M = locate(href_list["rename"])
if(!istype(M)) return
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index d41acc78e51..1a2fc842495 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -292,7 +292,7 @@ datum/mind
assigned_role = new_role
else if (href_list["memory_edit"])
- var/new_memo = input("Write new memory", "Memory", memory) as null|message
+ var/new_memo = copytext(sanitize(input("Write new memory", "Memory", memory) as null|message),1,MAX_MESSAGE_LEN)
if (isnull(new_memo)) return
memory = new_memo
@@ -399,7 +399,7 @@ datum/mind
new_objective.target_amount = target_number
if ("custom")
- var/expl = input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null
+ var/expl = copytext(sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null),1,MAX_MESSAGE_LEN)
if (!expl) return
new_objective = new /datum/objective
new_objective.owner = src
diff --git a/code/defines/global.dm b/code/defines/global.dm
index ad0687c0529..83d2197b158 100644
--- a/code/defines/global.dm
+++ b/code/defines/global.dm
@@ -164,6 +164,7 @@ var
//Don't set this very much higher then 1024 unless you like inviting people in to dos your server with message spam
const/MAX_MESSAGE_LEN = 1024
+ const/MAX_NAME_LEN = 26
const/shuttle_time_in_station = 1800 // 3 minutes in the station
const/shuttle_time_to_arrive = 6000 // 10 minutes to arrive
diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm
index 62528d674a6..3008da93100 100644
--- a/code/defines/procs/helpers.dm
+++ b/code/defines/procs/helpers.dm
@@ -681,15 +681,15 @@ Turf and target are seperate in case you want to teleport some distance from a t
/proc/ainame(var/mob/M as mob)
var/randomname = M.name
var/time_passed = world.time//Pretty basic but it'll do. It's still possible to bypass this by return ainame().
- var/newname = input(M,"You are the AI. Would you like to change your name to something else?", "Name change",randomname)
+ var/newname = copytext(sanitize(input(M,"You are the AI. Would you like to change your name to something else?", "Name change",randomname)),1,MAX_NAME_LEN)
if((world.time-time_passed)>200)//If more than 20 game seconds passed.
M << "You took too long to decide. Default name selected."
return
- if (length(newname) == 0)
+ if (!newname)
newname = randomname
- if (newname)
+ else
if (newname == "Inactive AI")//Keeping this here to prevent dumb.
M << "That name is reserved."
return ainame(M)
@@ -697,22 +697,19 @@ Turf and target are seperate in case you want to teleport some distance from a t
if (A.real_name == newname&&newname!=randomname)
M << "There's already an AI with that name."
return ainame(M)
- if (length(newname) >= 26)
- newname = copytext(newname, 1, 26)
- newname = dd_replacetext(newname, ">", "'")
M.real_name = newname
M.name = newname
M.original_name = newname
/proc/clname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea
var/randomname = pick(clown_names)
- var/newname = input(M,"You are the clown. Would you like to change your name to something else?", "Name change",randomname)
+ var/newname = copytext(sanitize(input(M,"You are the clown. Would you like to change your name to something else?", "Name change",randomname)),1,MAX_NAME_LEN)
var/oldname = M.real_name
- if (length(newname) == 0)
+ if (!newname)
newname = randomname
- if (newname)
+ else
var/badname = 0
switch(newname)
if("Unknown") badname = 1
@@ -729,9 +726,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
if(A.real_name == newname)
M << "That name is reserved."
return clname(M)
- if(length(newname) >= 26)
- newname = copytext(newname, 1, 26)
- newname = dd_replacetext(newname, ">", "'")
M.real_name = newname
M.name = newname
M.original_name = newname
diff --git a/code/game/gamemodes/events/space_ninja.dm b/code/game/gamemodes/events/space_ninja.dm
index de354bd3d56..d47dec3dd55 100644
--- a/code/game/gamemodes/events/space_ninja.dm
+++ b/code/game/gamemodes/events/space_ninja.dm
@@ -410,7 +410,7 @@ As such, it's hard-coded for now. No reason for it not to be, really.
var/mission
while(!mission)
- mission = input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "")
+ mission = copytext(sanitize(input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!mission)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm
index be3007195a3..397477f8d42 100644
--- a/code/game/gamemodes/nuclear/nuclear.dm
+++ b/code/game/gamemodes/nuclear/nuclear.dm
@@ -333,18 +333,15 @@
/proc/nukelastname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea. Also praise Urist for copypasta ho.
var/randomname = pick(last_names)
- var/newname = input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname)
+ var/newname = copytext(sanitize(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname)),1,MAX_NAME_LEN)
- if (length(newname) == 0)
+ if (!newname)
newname = randomname
- if (newname)
- if (newname == "Unknown")
+ else
+ if (newname == "Unknown" || newname == "floor" || newname == "wall" || newname == "rwall" || newname == "_")
M << "That name is reserved."
return nukelastname(M)
- if (length(newname) >= 26)
- newname = copytext(newname, 1, 26)
- newname = dd_replacetext(newname, ">", "'")
return newname
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index 488825a3917..2898de8f41d 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -338,7 +338,7 @@ datum/objective/steal
var/tmp_obj = new custom_target
var/custom_name = tmp_obj:name
del(tmp_obj)
- custom_name = input("Enter target name:", "Objective target", custom_name) as text|null
+ custom_name = copytext(sanitize(input("Enter target name:", "Objective target", custom_name) as text|null),1,MAX_MESSAGE_LEN)
if (!custom_name) return
target_name = custom_name
steal_target = custom_target
diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm
index 3c7f6247b15..b7c986e0ec1 100644
--- a/code/game/gamemodes/wizard/wizard.dm
+++ b/code/game/gamemodes/wizard/wizard.dm
@@ -116,15 +116,11 @@
var/wizard_name_second = pick(wizard_second)
var/randomname = "[wizard_name_first] [wizard_name_second]"
spawn(0)
- var/newname = input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text
+ var/newname = copytext(sanitize(input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN)
- if (length(newname) == 0)
+ if (!newname)
newname = randomname
- if (newname)
- if (length(newname) >= 26)
- newname = copytext(newname, 1, 26)
- newname = dd_replacetext(newname, ">", "'")
wizard_mob.real_name = newname
wizard_mob.name = newname
return
diff --git a/code/game/jobs/job/civilian_chaplain.dm b/code/game/jobs/job/civilian_chaplain.dm
index 5b0d5a04b05..be8c830895c 100644
--- a/code/game/jobs/job/civilian_chaplain.dm
+++ b/code/game/jobs/job/civilian_chaplain.dm
@@ -20,15 +20,11 @@
H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes)
spawn(0)
var/religion_name = "Christianity"
- var/new_religion = input(H, "You are the Chaplain. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name)
+ var/new_religion = copytext(sanitize(input(H, "You are the Chaplain. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name)),1,MAX_NAME_LEN)
if ((length(new_religion) == 0) || (new_religion == "Christianity"))
new_religion = religion_name
- if (new_religion)
- if (length(new_religion) >= 26)
- new_religion = copytext(new_religion, 1, 26)
- new_religion = dd_replacetext(new_religion, ">", "'")
switch(lowertext(new_religion))
if("christianity")
B.name = pick("The Holy Bible","The Dead Sea Scrolls")
@@ -59,15 +55,10 @@
spawn(1)
var/deity_name = "Space Jesus"
- var/new_deity = input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name)
+ var/new_deity = copytext(sanitize(input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name)),1,MAX_NAME_LEN)
if ((length(new_deity) == 0) || (new_deity == "Space Jesus") )
new_deity = deity_name
-
- if(new_deity)
- if (length(new_deity) >= 26)
- new_deity = copytext(new_deity, 1, 26)
- new_deity = dd_replacetext(new_deity, ">", "'")
B.deity_name = new_deity
var/accepted = 0
diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm
index 0db85a21b42..348710f1d29 100644
--- a/code/game/machinery/bots/mulebot.dm
+++ b/code/game/machinery/bots/mulebot.dm
@@ -372,7 +372,7 @@
if("setid")
refresh=0
- var/new_id = input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null
+ var/new_id = copytext(sanitize(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null),1,MAX_NAME_LEN)
refresh=1
if(new_id)
suffix = new_id
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index f18014c282a..bec9773a9e9 100644
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -97,7 +97,7 @@
if("announce")
if(src.authenticated==2)
if(message_cooldown) return
- var/input = input(usr, "Please choose a message to announce to the station crew.", "What?", "")
+ var/input = copytext(sanitize(input(usr, "Please choose a message to announce to the station crew.", "What?", "")),1,MAX_MESSAGE_LEN)
if(!input || !(usr in view(1,src)))
return
captain_announce(input)//This should really tell who is, IE HoP, CE, HoS, RD, Captain
@@ -176,7 +176,7 @@
if(centcomm_message_cooldown)
usr << "Arrays recycling. Please stand by."
return
- var/input = input(usr, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")
+ var/input = copytext(sanitize(input(usr, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")),1,MAX_MESSAGE_LEN)
if(!input || !(usr in view(1,src)))
return
Centcomm_announce(input, usr)
@@ -193,7 +193,7 @@
if(centcomm_message_cooldown)
usr << "Arrays recycling. Please stand by."
return
- var/input = input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")
+ var/input = copytext(sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")),1,MAX_MESSAGE_LEN)
if(!input || !(usr in view(1,src)))
return
Syndicate_announce(input, usr)
diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm
index 212030a3845..f74e6f119a3 100644
--- a/code/game/machinery/computer/medical.dm
+++ b/code/game/machinery/computer/medical.dm
@@ -183,7 +183,7 @@
switch(href_list["field"])
if("fingerprint")
if (istype(src.active1, /datum/data/record))
- var/t1 = input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text
+ var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["fingerprint"] = t1
@@ -195,61 +195,61 @@
src.active1.fields["sex"] = "Male"
if("age")
if (istype(src.active1, /datum/data/record))
- var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as text
+ var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as num
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["age"] = t1
if("mi_dis")
if (istype(src.active2, /datum/data/record))
- var/t1 = input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text
+ var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["mi_dis"] = t1
if("mi_dis_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message
+ var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["mi_dis_d"] = t1
if("ma_dis")
if (istype(src.active2, /datum/data/record))
- var/t1 = input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text
+ var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["ma_dis"] = t1
if("ma_dis_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message
+ var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["ma_dis_d"] = t1
if("alg")
if (istype(src.active2, /datum/data/record))
- var/t1 = input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text
+ var/t1 = copytext(sanitize(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["alg"] = t1
if("alg_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message
+ var/t1 = copytext(sanitize(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["alg_d"] = t1
if("cdi")
if (istype(src.active2, /datum/data/record))
- var/t1 = input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text
+ var/t1 = copytext(sanitize(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["cdi"] = t1
if("cdi_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message
+ var/t1 = copytext(sanitize(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["cdi_d"] = t1
if("notes")
if (istype(src.active2, /datum/data/record))
- var/t1 = input("Please summarize notes:", "Med. records", src.active2.fields["notes"], null) as message
+ var/t1 = copytext(sanitize(input("Please summarize notes:", "Med. records", src.active2.fields["notes"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["notes"] = t1
@@ -264,7 +264,7 @@
src.temp = text("Blood Type:
\n\tA- A+
\n\tB- B+
\n\tAB- AB+
\n\tO- O+
", src, src, src, src, src, src, src, src)
if("b_dna")
if (istype(src.active1, /datum/data/record))
- var/t1 = input("Please input DNA hash:", "Med. records", src.active1.fields["dna"], null) as text
+ var/t1 = copytext(sanitize(input("Please input DNA hash:", "Med. records", src.active1.fields["dna"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["dna"] = t1
@@ -365,7 +365,7 @@
if (!( istype(src.active2, /datum/data/record) ))
return
var/a2 = src.active2
- var/t1 = input("Add Comment:", "Med. records", null, null) as message
+ var/t1 = copytext(sanitize(input("Add Comment:", "Med. records", null, null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
var/counter = 1
diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm
index 9863a73256e..adc45dc3748 100644
--- a/code/game/machinery/computer/prisoner.dm
+++ b/code/game/machinery/computer/prisoner.dm
@@ -94,7 +94,8 @@
usr << "Unauthorized Access."
else if(href_list["warn"])
- var/warning = input(usr,"Message:","Enter your message here!","")
+ var/warning = copytext(sanitize(input(usr,"Message:","Enter your message here!","")),1,MAX_MESSAGE_LEN)
+ if(!warning) return
var/obj/item/weapon/implant/I = locate(href_list["warn"])
if((I)&&(I.imp_in))
var/mob/living/carbon/R = I.imp_in
diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index 1f6dab284fd..acff945c5fb 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -322,7 +322,7 @@ What a mess.*/
if (!( istype(active2, /datum/data/record) ))
return
var/a2 = active2
- var/t1 = input("Add Comment:", "Secure. records", null, null) as message
+ var/t1 = copytext(sanitize(input("Add Comment:", "Secure. records", null, null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
var/counter = 1
@@ -389,13 +389,13 @@ What a mess.*/
active1.fields["name"] = t1
if("id")
if (istype(active2, /datum/data/record))
- var/t1 = input("Please input id:", "Secure. records", active1.fields["id"], null) as text
+ var/t1 = copytext(sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["id"] = t1
if("fingerprint")
if (istype(active1, /datum/data/record))
- var/t1 = input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text
+ var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["fingerprint"] = t1
@@ -407,37 +407,37 @@ What a mess.*/
active1.fields["sex"] = "Male"
if("age")
if (istype(active1, /datum/data/record))
- var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as text
+ var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as num
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["age"] = t1
if("mi_crim")
if (istype(active2, /datum/data/record))
- var/t1 = input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text
+ var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["mi_crim"] = t1
if("mi_crim_d")
if (istype(active2, /datum/data/record))
- var/t1 = input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message
+ var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["mi_crim_d"] = t1
if("ma_crim")
if (istype(active2, /datum/data/record))
- var/t1 = input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text
+ var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["ma_crim"] = t1
if("ma_crim_d")
if (istype(active2, /datum/data/record))
- var/t1 = input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message
+ var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["ma_crim_d"] = t1
if("notes")
if (istype(active2, /datum/data/record))
- var/t1 = input("Please summarize notes:", "Secure. records", active2.fields["notes"], null) as message
+ var/t1 = copytext(sanitize(input("Please summarize notes:", "Secure. records", active2.fields["notes"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["notes"] = t1
diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm
index 46385e4686a..f7dd8539ad8 100644
--- a/code/game/machinery/magnet.dm
+++ b/code/game/machinery/magnet.dm
@@ -323,7 +323,7 @@
if(speed <= 0)
speed = 1
if("setpath")
- var/newpath = input(usr, "Please define a new path!",,path) as text|null
+ var/newpath = copytext(sanitize(input(usr, "Please define a new path!",,path) as text|null),1,MAX_MESSAGE_LEN)
if(newpath && newpath != "")
moving = 0 // stop moving
path = newpath
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 88711376da9..fe89e8309ae 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -193,7 +193,7 @@ Transponder Codes:
"}
updateDialog()
else if(href_list["locedit"])
- var/newloc = input("Enter New Location", "Navigation Beacon", location) as text|null
+ var/newloc = copytext(sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null),1,MAX_MESSAGE_LEN)
if(newloc)
location = newloc
updateDialog()
diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm
index 9a02fe6025b..6f59e606fd5 100644
--- a/code/game/machinery/requests_console.dm
+++ b/code/game/machinery/requests_console.dm
@@ -203,7 +203,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
if(reject_bad_text(href_list["write"]))
dpt = ckey(href_list["write"]) //write contains the string of the receiving department's name
- var/new_message = reject_bad_text(input(usr, "Write your message:", "Awaiting Input", ""))
+ var/new_message = copytext(reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")),1,MAX_MESSAGE_LEN)
if(new_message)
message = new_message
screen = 9
@@ -218,7 +218,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
priority = -1
if(href_list["writeAnnouncement"])
- var/new_message = reject_bad_text(input(usr, "Write your message:", "Awaiting Input", ""))
+ var/new_message = copytext(reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")),1,MAX_MESSAGE_LEN)
if(new_message)
message = new_message
switch(href_list["priority"])
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index d4ca611060e..2c3a952cdbe 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -176,7 +176,7 @@
switch(href_list["input"])
if("id")
- var/newid = input(usr, "Specify the new ID for this machine", src, id) as null|text
+ var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN)
if(newid && usr in range(1, src))
id = newid
temp = "-% New ID assigned: \"[id]\" %-"
diff --git a/code/game/magic/cultist/runes.dm b/code/game/magic/cultist/runes.dm
index 68e023d2fe2..415b6a512ff 100644
--- a/code/game/magic/cultist/runes.dm
+++ b/code/game/magic/cultist/runes.dm
@@ -522,7 +522,7 @@ var/list/sacrificed = list()
/////////////////////////////////////////FOURTEETH RUNE
communicate()
- var/input = input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "") as text|null
+ var/input = copytext(sanitize(input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "") as text|null),1,MAX_MESSAGE_LEN)
if(!input)
if (istype(src))
return fizzle()
diff --git a/code/game/magic/library.dm b/code/game/magic/library.dm
index 5bd23892c0e..a5b9e0b8740 100644
--- a/code/game/magic/library.dm
+++ b/code/game/magic/library.dm
@@ -82,7 +82,7 @@
user.drop_item()
O.loc = src
else if(istype(O, /obj/item/weapon/pen))
- var/newname = input("What would you like to title this bookshelf?") as text|null
+ var/newname = copytext(sanitize(input("What would you like to title this bookshelf?") as text|null),1,MAX_MESSAGE_LEN)
if(!newname)
return
else
@@ -193,11 +193,9 @@
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
switch(choice)
if("Title")
- var/title = input("Write a new title:") as text|null
+ var/title = copytext(sanitize(input("Write a new title:") as text|null),1,MAX_MESSAGE_LEN)
if(!title)
return
- else
- src.name = sanitize(title)
else if("Contents")
var/content = strip_html(input("Write your book's contents (HTML NOT allowed):"),8192) as message|null
if(!content)
@@ -205,7 +203,7 @@
else
src.dat += content
else if("Author")
- var/nauthor = input("Write the author's name:") as text|null
+ var/nauthor = copytext(sanitize(input("Write the author's name:") as text|null),1,MAX_NAME_LEN)
if(!nauthor)
return
else
@@ -592,9 +590,9 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
if(checkoutperiod < 1)
checkoutperiod = 1
if(href_list["editbook"])
- buffer_book = input("Enter the book's title:") as text|null
+ buffer_book = copytext(sanitize(input("Enter the book's title:") as text|null),1,MAX_MESSAGE_LEN)
if(href_list["editmob"])
- buffer_mob = input("Enter the recipient's name:") as text|null
+ buffer_mob = copytext(sanitize(input("Enter the recipient's name:") as text|null),1,MAX_NAME_LEN)
if(href_list["checkout"])
var/datum/borrowbook/b = new /datum/borrowbook
b.bookname = sanitize(buffer_book)
@@ -609,9 +607,9 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
var/obj/item/weapon/book/b = locate(href_list["delbook"])
inventory.Remove(b)
if(href_list["setauthor"])
- var/newauthor = input("Enter the author's name: ") as text|null
+ var/newauthor = copytext(sanitize(input("Enter the author's name: ") as text|null),1,MAX_MESSAGE_LEN)
if(newauthor)
- scanner.cache.author = sanitize(newauthor)
+ scanner.cache.author = newauthor
if(href_list["setcategory"])
var/newcategory = input("Choose a category: ") in list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion")
if(newcategory)
diff --git a/code/game/objects/devices/paicard.dm b/code/game/objects/devices/paicard.dm
index 6d74d416465..4dd15add607 100644
--- a/code/game/objects/devices/paicard.dm
+++ b/code/game/objects/devices/paicard.dm
@@ -76,7 +76,7 @@
if (radio.wires & t1)
radio.wires &= ~t1
if(href_list["setlaws"])
- var/newlaws = input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message
+ var/newlaws = copytext(sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message),1,MAX_MESSAGE_LEN)
if(newlaws)
pai.pai_laws = newlaws
pai << "Your supplemental directives have been updated. Your new directives are:"
diff --git a/code/game/objects/items/robot_parts.dm b/code/game/objects/items/robot_parts.dm
index 1d4a2ab63f2..0e788e4b85b 100644
--- a/code/game/objects/items/robot_parts.dm
+++ b/code/game/objects/items/robot_parts.dm
@@ -220,7 +220,7 @@
if (istype(W, /obj/item/weapon/pen))
var/t = input(user, "Enter new robot name", src.name, src.created_name) as text
- t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
+ t = copytext(sanitize(t), 1, MAX_NAME_LEN)
if (!t)
return
if (!in_range(src, usr) && src.loc != usr)
diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm
index 6b55a92fa30..016b0755445 100644
--- a/code/game/objects/items/weapons/AI_modules.dm
+++ b/code/game/objects/items/weapons/AI_modules.dm
@@ -89,8 +89,8 @@ AI MODULES
/obj/item/weapon/aiModule/safeguard/attack_self(var/mob/user as mob)
..()
- var/targName = input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)
- targetName = sanitize(targName)
+ var/targName = copytext(sanitize(input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)),1,MAX_MESSAGE_LEN)
+ targetName = targName
desc = text("A 'safeguard' AI module: 'Safeguard []. Individuals that threaten [] are not human and are a threat to humans.'", targetName, targetName)
/obj/item/weapon/aiModule/safeguard/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -112,8 +112,8 @@ AI MODULES
/obj/item/weapon/aiModule/oneHuman/attack_self(var/mob/user as mob)
..()
- var/targName = input(usr, "Please enter the name of the person who is the only human.", "Who?", user.real_name)
- targetName = sanitize(targName)
+ var/targName = copytext(sanitize(input(usr, "Please enter the name of the person who is the only human.", "Who?", user.real_name)),1,MAX_MESSAGE_LEN)
+ targetName = targName
desc = text("A 'one human' AI module: 'Only [] is human.'", targetName)
/obj/item/weapon/aiModule/oneHuman/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -245,8 +245,8 @@ AI MODULES
lawpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num
lawpos = min(lawpos, 50)
var/newlaw = ""
- var/targName = input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)
- newFreeFormLaw = sanitize(targName)
+ var/targName = copytext(sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
+ newFreeFormLaw = targName
desc = "A 'freeform' AI module: ([lawpos]) '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/freeform/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -370,8 +370,8 @@ AI MODULES
/obj/item/weapon/aiModule/freeformcore/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
- var/targName = input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw)
- newFreeFormLaw = sanitize(targName)
+ var/targName = copytext(sanitize(input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
+ newFreeFormLaw = targName
desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/freeformcore/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -391,8 +391,8 @@ AI MODULES
/obj/item/weapon/aiModule/syndicate/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
- var/targName = input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)
- newFreeFormLaw = sanitize(targName)
+ var/targName = copytext(sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
+ newFreeFormLaw = targName
desc = "A hacked AI law module: '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/syndicate/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm
index 90f1b23fa70..506b55e80ca 100644
--- a/code/game/objects/items/weapons/explosives.dm
+++ b/code/game/objects/items/weapons/explosives.dm
@@ -1,5 +1,7 @@
/obj/item/weapon/plastique/attack_self(mob/user as mob)
- var/newtime = input(usr, "Please set the timer.", "Timer", 10)
+ var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
+ if(newtime < 1)
+ newtime = 10
timer = newtime
user << "Timer set for [timer] seconds."
diff --git a/code/game/objects/items/weapons/wrappingpaper.dm b/code/game/objects/items/weapons/wrappingpaper.dm
index 764ba3c2698..7770ea23b61 100644
--- a/code/game/objects/items/weapons/wrappingpaper.dm
+++ b/code/game/objects/items/weapons/wrappingpaper.dm
@@ -222,8 +222,7 @@ PHOTOGRAPHS
/obj/item/weapon/paper/photograph/attack_self(mob/user as mob)
- var/n_name = input(user, "What would you like to label the photo?", "Paper Labelling", null) as text
- n_name = copytext(n_name, 1, 32)
+ var/n_name = copytext(sanitize(input(user, "What would you like to label the photo?", "Paper Labelling", null) as text),1,32)
if ((src.loc == user && user.stat == 0))
src.name = text("photo[]", (n_name ? text("- '[]'", n_name) : null))
src.add_fingerprint(user)
diff --git a/code/game/objects/storage/uplink_kits.dm b/code/game/objects/storage/uplink_kits.dm
new file mode 100644
index 00000000000..1ef400a9721
--- /dev/null
+++ b/code/game/objects/storage/uplink_kits.dm
@@ -0,0 +1,53 @@
+/obj/item/weapon/storage/syndie_kit
+ name = "Box"
+ desc = "A sleek, sturdy box"
+ icon_state = "box_of_doom"
+ item_state = "syringe_kit"
+
+/obj/item/weapon/storage/syndie_kit/imp_freedom
+ name = "Freedom Implant (with injector)"
+
+/obj/item/weapon/storage/syndie_kit/imp_freedom/New()
+ var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
+ O.imp = new /obj/item/weapon/implant/freedom(O)
+ O.update()
+ ..()
+ return
+
+/*/obj/item/weapon/storage/syndie_kit/imp_compress
+ name = "Compressed Matter Implant (with injector)"
+
+/obj/item/weapon/storage/syndie_kit/imp_compress/New()
+ new /obj/item/weapon/implanter/compressed(src)
+ ..()
+ return
+
+/obj/item/weapon/storage/syndie_kit/imp_explosive
+ name = "Explosive Implant (with injector)"
+
+/obj/item/weapon/storage/syndie_kit/imp_explosive/New()
+ var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
+ O.imp = new /obj/item/weapon/implant/explosive(O)
+ O.name = "(BIO-HAZARD) BIO-detpack"
+ O.update()
+ ..()
+ return*/
+
+/obj/item/weapon/storage/syndie_kit/imp_uplink
+ name = "Uplink Implant (with injector)"
+
+/obj/item/weapon/storage/syndie_kit/imp_uplink/New()
+ var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
+ O.imp = new /obj/item/weapon/implant/uplink(O)
+ O.update()
+ ..()
+ return
+
+/obj/item/weapon/storage/syndie_kit/space
+ name = "Space Suit and Helmet"
+
+/obj/item/weapon/storage/syndie_kit/space/New()
+ new /obj/item/clothing/suit/space/syndicate(src)
+ new /obj/item/clothing/head/helmet/space/syndicate(src)
+ ..()
+ return
diff --git a/code/game/objects/uplinks.dm b/code/game/objects/uplinks.dm
new file mode 100644
index 00000000000..40d2849af1d
--- /dev/null
+++ b/code/game/objects/uplinks.dm
@@ -0,0 +1,467 @@
+//This could either be split into the proper DM files or placed somewhere else all together, but it'll do for now -Nodrak
+
+/*
+
+SYNDICATE UPLINKS
+
+TO-DO:
+ Once wizard is fixed, make sure the uplinks work correctly for it. wizard.dm is right now uncompiled and with broken code in it.
+
+ Clean the code up and comment it. Part of it is right now copy-pasted, with the general Topic() and modifications by Abi79.
+
+ I should take a more in-depth look at both the copy-pasted code for the individual uplinks below, and at each gamemode's code
+ to see how uplinks are assigned and if there are any bugs with those.
+
+
+A list of items and costs is stored under the datum of every game mode, alongside the number of crystals, and the welcoming message.
+
+*/
+
+/obj/item/device/uplink
+ var/welcome // Welcoming menu message
+ var/menu_message = "" // The actual menu text
+ var/items // List of items
+ var/list/ItemList // Parsed list of items
+ var/uses // Numbers of crystals
+ // List of items not to shove in their hands.
+ var/list/NotInHand = list(/obj/machinery/singularity_beacon/syndicate)
+
+ New()
+ welcome = ticker.mode.uplink_welcome
+ items = dd_replacetext(ticker.mode.uplink_items, "\n", "") // Getting the text string of items
+ ItemList = dd_text2list(src.items, ";") // Parsing the items text string
+ uses = ticker.mode.uplink_uses
+
+//Let's build a menu!
+ proc/generate_menu()
+ src.menu_message = "[src.welcome]
"
+ src.menu_message += "Tele-Crystals left: [src.uses]
"
+ src.menu_message += "
"
+ src.menu_message += "Request item:
"
+ src.menu_message += "Each item costs a number of tele-crystals as indicated by the number following their name.
"
+
+ var/cost
+ var/item
+ var/name
+ var/path_obj
+ var/path_text
+ var/category_items = 1 //To prevent stupid :P
+
+ for(var/D in ItemList)
+ var/list/O = stringsplit(D, ":")
+ if(O.len != 3) //If it is not an actual item, make a break in the menu.
+ if(O.len == 1) //If there is one item, it's probably a title
+ src.menu_message += "[O[1]]
"
+ category_items = 0
+ else //Else, it's a white space.
+ if(category_items < 1) //If there were no itens in the last category...
+ src.menu_message += "We apologize, as you could not afford anything from this category.
"
+ src.menu_message += "
"
+ continue
+
+ path_text = O[1]
+ cost = text2num(O[2])
+
+ if(cost>uses)
+ continue
+
+ path_obj = text2path(path_text)
+ item = new path_obj()
+ name = O[3]
+ del item
+
+ src.menu_message += "[name] ([cost])
"
+ category_items++
+
+ src.menu_message += "Random Item (??)
"
+ src.menu_message += "
"
+ return
+
+ Topic(href, href_list)
+ if (href_list["buy_item"])
+ if(href_list["buy_item"] == "random")
+ var/list/randomItems = list()
+
+ //Sorry for all the ifs, but it makes it 1000 times easier for other people/servers to add or remove items from this list
+ //Add only items the player can afford:
+ if(uses > 19)
+ randomItems.Add("/obj/item/weapon/circuitboard/teleporter") //Teleporter Circuit Board (costs 20, for nuke ops)
+
+ if(uses > 9)
+ randomItems.Add("/obj/item/toy/syndicateballoon")//Syndicate Balloon
+ randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_uplink") //Uplink Implanter
+ randomItems.Add("/obj/item/weapon/storage/box/syndicate") //Syndicate bundle
+
+ //if(uses > 8) //Nothing... yet.
+ //if(uses > 7) //Nothing... yet.
+
+ if(uses > 6)
+ randomItems.Add("/obj/item/weapon/aiModule/syndicate") //Hacked AI Upload Module
+ randomItems.Add("/obj/item/device/radio/beacon/syndicate") //Singularity Beacon
+
+ if(uses > 5)
+ randomItems.Add("/obj/item/weapon/gun/projectile") //Revolver
+
+ if(uses > 4)
+ randomItems.Add("/obj/item/weapon/gun/energy/crossbow") //Energy Crossbow
+ randomItems.Add("/obj/item/device/powersink") //Powersink
+
+ if(uses > 3)
+ randomItems.Add("/obj/item/weapon/melee/energy/sword") //Energy Sword
+ randomItems.Add("/obj/item/clothing/mask/gas/voice") //Voice Changer
+ randomItems.Add("/obj/item/device/chameleon") //Chameleon Projector
+
+ if(uses > 2)
+ randomItems.Add("/obj/item/weapon/storage/emp_kit") //EMP Grenades
+ randomItems.Add("/obj/item/weapon/pen/paralysis") //Paralysis Pen
+ randomItems.Add("/obj/item/weapon/cartridge/syndicate") //Detomatix Cartridge
+ randomItems.Add("/obj/item/clothing/under/chameleon") //Chameleon Jumpsuit
+ randomItems.Add("/obj/item/weapon/card/id/syndicate") //Agent ID Card
+ randomItems.Add("/obj/item/weapon/card/emag") //Cryptographic Sequencer
+ randomItems.Add("/obj/item/weapon/storage/syndie_kit/space") //Syndicate Space Suit
+ randomItems.Add("/obj/item/device/encryptionkey/binary") //Binary Translator Key
+ randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_freedom") //Freedom Implant
+ randomItems.Add("/obj/item/clothing/glasses/thermal") //Thermal Imaging Goggles
+
+ if(uses > 1)
+/*
+ var/list/usrItems = usr.get_contents() //Checks to see if the user has a revolver before giving ammo
+ var/hasRevolver = 0
+ for(var/obj/I in usrItems) //Only add revolver ammo if the user has a gun that can shoot it
+ if(istype(I,/obj/item/weapon/gun/projectile))
+ hasRevolver = 1
+
+ if(hasRevolver) randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
+*/
+ randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
+ randomItems.Add("/obj/item/clothing/shoes/syndigaloshes") //No-Slip Syndicate Shoes
+ randomItems.Add("/obj/item/weapon/plastique") //C4
+
+ if(uses > 0)
+ randomItems.Add("/obj/item/weapon/soap/syndie") //Syndicate Soap
+ randomItems.Add("/obj/item/weapon/storage/toolbox/syndicate") //Syndicate Toolbox
+
+ if(!randomItems)
+ del(randomItems)
+ return 0
+ else
+ href_list["buy_item"] = pick(randomItems)
+
+ switch(href_list["buy_item"]) //Ok, this gets a little messy, sorry.
+ if("/obj/item/weapon/circuitboard/teleporter")
+ uses -= 20
+ if("/obj/item/toy/syndicateballoon" , "/obj/item/weapon/storage/syndie_kit/imp_uplink" , "/obj/item/weapon/storage/box/syndicate")
+ uses -= 10
+ if("/obj/item/weapon/aiModule/syndicate" , "/obj/item/device/radio/beacon/syndicate")
+ uses -= 7
+ if("/obj/item/weapon/gun/projectile")
+ uses -= 6
+ if("/obj/item/weapon/gun/energy/crossbow" , "/obj/item/device/powersink")
+ uses -= 5
+ if("/obj/item/weapon/melee/energy/sword" , "/obj/item/clothing/mask/gas/voice" , "/obj/item/device/chameleon")
+ uses -= 4
+ if("/obj/item/weapon/storage/emp_kit" , "/obj/item/weapon/pen/paralysis" , "/obj/item/weapon/cartridge/syndicate" , "/obj/item/clothing/under/chameleon" , \
+ "/obj/item/weapon/card/id/syndicate" , "/obj/item/weapon/card/emag" , "/obj/item/weapon/storage/syndie_kit/space" , "/obj/item/device/encryptionkey/binary" , \
+ "/obj/item/weapon/storage/syndie_kit/imp_freedom" , "/obj/item/clothing/glasses/thermal")
+ uses -= 3
+ if("/obj/item/ammo_magazine/a357" , "/obj/item/clothing/shoes/syndigaloshes" , "/obj/item/weapon/plastique")
+ uses -= 2
+ if("/obj/item/weapon/soap/syndie" , "/obj/item/weapon/storage/toolbox/syndicate")
+ uses -= 1
+
+ del(randomItems)
+ return 1
+
+
+
+ if(text2num(href_list["cost"]) > uses) // Not enough crystals for the item
+ return 0
+
+ //if(usr:mind && ticker.mode.traitors[usr:mind])
+ //var/datum/traitorinfo/info = ticker.mode.traitors[usr:mind]
+ //info.spawnlist += href_list["buy_item"]
+
+ uses -= text2num(href_list["cost"])
+
+ return 1
+
+
+/*
+ *PDA uplink
+ */
+
+//Syndicate uplink hidden inside a traitor PDA
+//Communicate with traitor through the PDA's note function.
+
+/obj/item/device/uplink/pda
+ name = "uplink module"
+ desc = "An electronic uplink system of unknown origin."
+ icon = 'module.dmi'
+ icon_state = "power_mod"
+ var/obj/item/device/pda/hostpda = null
+
+ var/orignote = null //Restore original notes when locked.
+ var/active = 0 //Are we currently active?
+ var/lock_code = "" //The unlocking password.
+
+ proc
+ unlock()
+ if ((isnull(src.hostpda)) || (src.active))
+ return
+
+ src.orignote = src.hostpda.note
+ src.active = 1
+ src.hostpda.mode = 1 //Switch right to the notes program
+
+ src.generate_menu()
+ print_to_host(menu_message)
+
+ for (var/mob/M in viewers(1, src.hostpda.loc))
+ if (M.client && M.machine == src.hostpda)
+ src.hostpda.attack_self(M)
+
+ return
+
+ print_to_host(var/text)
+ if (isnull(hostpda))
+ return
+ hostpda.note = text
+
+ for (var/mob/M in viewers(1, hostpda.loc))
+ if (M.client && M.machine == hostpda)
+ hostpda.attack_self(M)
+ return
+
+ shutdown_uplink()
+ if (isnull(src.hostpda))
+ return
+ active = 0
+ hostpda.note = orignote
+ if (hostpda.mode==1)
+ hostpda.mode = 0
+ hostpda.updateDialog()
+ return
+
+ attack_self(mob/user as mob)
+ src.generate_menu()
+ src.hostpda.note = src.menu_message
+
+
+ Topic(href, href_list)
+ if ((isnull(src.hostpda)) || (!src.active))
+ return
+
+ if (usr.stat || usr.restrained() || !in_range(src.hostpda, usr))
+ return
+
+ if(..() == 1) // We can afford the item
+ var/path_obj = text2path(href_list["buy_item"])
+ var/mob/A = src.hostpda.loc
+ var/item = new path_obj(get_turf(src.hostpda))
+ if(ismob(A) && !(locate(item) in NotInHand)) //&& !istype(item, /obj/spawner))
+ if(!A.r_hand)
+ item:loc = A
+ A.r_hand = item
+ item:layer = 20
+ else if(!A.l_hand)
+ item:loc = A
+ A.l_hand = item
+ item:layer = 20
+ else
+ item:loc = get_turf(A)
+ usr.update_clothing()
+ // usr.client.onBought("[item:name]") When we have the stats again, uncomment.
+ /* if(istype(item, /obj/spawner)) // Spawners need to have del called on them to avoid leaving a marker behind
+ del item*/
+ //HEADFINDBACK
+ src.attack_self(usr)
+ src.hostpda.attack_self(usr)
+ return
+
+
+/*
+ *Portable radio uplink
+ */
+
+//A Syndicate uplink disguised as a portable radio
+/obj/item/device/uplink/radio/implanted
+ New()
+ ..()
+ uses = 5
+ return
+
+ explode()
+ var/obj/item/weapon/implant/uplink/U = src.loc
+ var/mob/living/A = U.imp_in
+ A.gib()
+ ..()
+// var/turf/location = get_turf(src.loc)
+// if(location)
+// location.hotspot_expose(700,125)
+// explosion(location, 0, 0, 2, 4, 1)
+
+// var/obj/item/weapon/implant/uplink/U = src.loc
+// var/mob/living/A = U.imp_in
+// var/datum/organ/external/head = A:organs["head"]
+// head.destroyed = 1
+// spawn(2)
+// head.droplimb()
+// del(src.master)
+// del(src)
+// return
+
+
+/obj/item/device/uplink/radio
+ name = "ship bounced radio"
+ icon = 'radio.dmi'
+ icon_state = "radio"
+ var/temp = null //Temporary storage area for a message offering the option to destroy the radio
+ var/selfdestruct = 0 //Set to 1 while the radio is self destructing itself.
+ var/obj/item/device/radio/origradio = null
+ flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
+ w_class = 2.0
+ item_state = "radio"
+ throwforce = 5
+ throw_speed = 4
+ throw_range = 20
+ m_amt = 100
+
+ attack_self(mob/user as mob)
+ var/dat
+
+ if (src.selfdestruct)
+ dat = "Self Destructing..."
+ else
+ if (src.temp)
+ dat = "[src.temp]
Clear"
+ else
+ src.generate_menu()
+ dat = src.menu_message
+ if (src.origradio) // Checking because sometimes the radio uplink may be spawned by itself, not as a normal unlockable radio
+ dat += "Lock
"
+ dat += "
"
+ dat += "Self-Destruct"
+
+ user << browse(dat, "window=radio")
+ onclose(user, "radio")
+ return
+
+ Topic(href, href_list)
+ if (usr.stat || usr.restrained())
+ return
+
+ if (!( istype(usr, /mob/living/carbon/human)))
+ return 1
+
+ if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || istype(src.loc,/obj/item/weapon/implant/uplink)))
+ usr.machine = src
+
+ if(href_list["buy_item"])
+ if(..() == 1) // We can afford the item
+ var/path_obj = text2path(href_list["buy_item"])
+ var/item = new path_obj(get_turf(src.loc))
+ var/mob/A = src.loc
+ if(istype(src.loc,/obj/item/weapon/implant/uplink))
+ var/obj/item/weapon/implant/uplink/U = src.loc
+ A = U.imp_in
+ if(ismob(A) && !(locate(item) in NotInHand)) //&& !istype(item, /obj/spawner))
+ if(!A.r_hand)
+ item:loc = A
+ A.r_hand = item
+ item:layer = 20
+ else if(!A.l_hand)
+ item:loc = A
+ A.l_hand = item
+ item:layer = 20
+ else
+ item:loc = get_turf(A)
+ /* if(istype(item, /obj/spawner)) // Spawners need to have del called on them to avoid leaving a marker behind
+ del item*/
+ // usr.client.onBought("[item:name]") When we have the stats again, uncomment.
+ src.attack_self(usr)
+ return
+
+ else if (href_list["lock"] && src.origradio)
+ // presto chango, a regular radio again! (reset the freq too...)
+ usr.machine = null
+ usr << browse(null, "window=radio")
+ var/obj/item/device/radio/T = src.origradio
+ var/obj/item/device/uplink/radio/R = src
+ R.loc = T
+ T.loc = usr
+ // R.layer = initial(R.layer)
+ R.layer = 0
+ if (usr.client)
+ usr.client.screen -= R
+ if (usr.r_hand == R)
+ usr.u_equip(R)
+ usr.r_hand = T
+
+ else
+ usr.u_equip(R)
+ usr.l_hand = T
+ R.loc = T
+ T.layer = 20
+ T.set_frequency(initial(T.frequency))
+ T.attack_self(usr)
+ return
+
+ else if (href_list["selfdestruct"])
+ src.temp = "Self-Destruct"
+
+ else if (href_list["selfdestruct2"])
+ src.selfdestruct = 1
+ spawn (100)
+ explode()
+ return
+
+ else if (href_list["clear_selfdestruct"])
+ src.temp = null
+
+ attack_self(usr)
+// if (istype(src.loc, /mob))
+// attack_self(src.loc)
+// else
+// for(var/mob/M in viewers(1, src))
+// if (M.client)
+// src.attack_self(M)
+ return
+
+ proc/explode()
+ var/turf/location = get_turf(src.loc)
+ if(location)
+ location.hotspot_expose(700,125)
+ explosion(location, 0, 0, 2, 4, 1)
+
+ del(src.master)
+ del(src)
+ return
+
+ proc/shutdown_uplink()
+ if (!src.origradio)
+ return
+ var/list/nearby = viewers(1, src)
+ for(var/mob/M in nearby)
+ if (M.client && M.machine == src)
+ M << browse(null, "window=radio")
+ M.machine = null
+
+ var/obj/item/device/radio/T = src.origradio
+ var/obj/item/device/uplink/radio/R = src
+ var/mob/L = src.loc
+ R.loc = T
+ T.loc = L
+ // R.layer = initial(R.layer)
+ R.layer = 0
+ if (istype(L))
+ if (L.client)
+ L.client.screen -= R
+ if (L.r_hand == R)
+ L.u_equip(R)
+ L.r_hand = T
+ else
+ L.u_equip(R)
+ L.l_hand = T
+ T.layer = 20
+ T.set_frequency(initial(T.frequency))
+ return
\ No newline at end of file
diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm
index a297b507a78..df9981a9337 100644
--- a/code/game/supplyshuttle.dm
+++ b/code/game/supplyshuttle.dm
@@ -337,7 +337,9 @@ This method wont take into account storage items developed in the future and doe
var/obj/item/weapon/paper/reqform = new /obj/item/weapon/paper(src.loc)
var/idname = "Unknown"
var/idrank = "Unknown"
- var/reason = input(usr,"Reason:","Why do you require this item?","")
+ var/reason = copytext(sanitize(input(usr,"Reason:","Why do you require this item?","")),1,MAX_MESSAGE_LEN)
+ if(!reason)
+ reason = "Unknown"
reqform.name = "Requisition Form - [P.name]"
reqform.info += "[station_name] Supply Requisition Form
"
@@ -538,7 +540,7 @@ This method wont take into account storage items developed in the future and doe
supply_shuttle_points -= P.cost
O.object = P
O.orderedby = usr.name
- O.comment = input(usr,"Comment:","Enter comment","")
+ O.comment = copytext(sanitize(input(usr,"Comment:","Enter comment","")),1,MAX_MESSAGE_LEN)
supply_shuttle_shoppinglist += O
src.temp = "Thanks for your order.
"
src.temp += "
OK"
@@ -554,7 +556,7 @@ This method wont take into account storage items developed in the future and doe
supply_shuttle_points -= P.cost
O.object = P
O.orderedby = usr.name
- O.comment = input(usr,"Comment:","Enter comment","")
+ O.comment = copytext(sanitize(input(usr,"Comment:","Enter comment","")),1,MAX_MESSAGE_LEN)
supply_shuttle_shoppinglist += O
src.temp = "Thanks for your order.
"
src.temp += "
OK"
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 7902fc99f27..427e9a10918 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -860,11 +860,10 @@ var/global/BSACooldown = 0
if ((src.rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
var/mob/M = locate(href_list["forcespeech"])
if (ismob(M))
- var/speech = input("What will [key_name(M)] say?.", "Force speech", "")
+ var/speech = copytext(sanitize(input("What will [key_name(M)] say?.", "Force speech", "")),1,MAX_MESSAGE_LEN)
if(!speech)
return
M.say(speech)
- speech = copytext(sanitize(speech), 1, MAX_MESSAGE_LEN)
log_admin("[key_name(usr)] forced [key_name(M)] to say: [speech]")
message_admins("\blue [key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]")
else
@@ -1732,7 +1731,7 @@ var/global/BSACooldown = 0
if(!ticker)
alert("The game hasn't started yet!")
return
- var/objective = input("Enter an objective")
+ var/objective = copytext(sanitize(input("Enter an objective")),1,MAX_MESSAGE_LEN)
if(!objective)
return
feedback_inc("admin_secrets_fun_used",1)
diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm
index 4e1e554e69a..1945d3d05a0 100644
--- a/code/modules/admin/verbs/striketeam.dm
+++ b/code/modules/admin/verbs/striketeam.dm
@@ -24,7 +24,7 @@ var/global/sent_strike_team = 0
var/input = null
while(!input)
- input = input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", "")
+ input = copytext(sanitize(input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
diff --git a/code/modules/admin/verbs/striketeam_syndicate.dm b/code/modules/admin/verbs/striketeam_syndicate.dm
index 779243eb7cb..9daf6e35138 100644
--- a/code/modules/admin/verbs/striketeam_syndicate.dm
+++ b/code/modules/admin/verbs/striketeam_syndicate.dm
@@ -24,7 +24,7 @@ var/global/sent_syndicate_strike_team = 0
var/input = null
while(!input)
- input = input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", "")
+ input = copytext(sanitize(input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm
index 38bcdf6d4c6..1da2e94e0f0 100644
--- a/code/modules/mob/living/carbon/human/emote.dm
+++ b/code/modules/mob/living/carbon/human/emote.dm
@@ -47,10 +47,9 @@
m_type = 1
if ("custom")
- var/input = input("Choose an emote to display.") as text|null
+ var/input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
if (!input)
return
- input = sanitize(input)
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
if (input2 == "Visible")
m_type = 1
diff --git a/code/modules/mob/living/silicon/robot/emote.dm b/code/modules/mob/living/silicon/robot/emote.dm
index 8b33e6219df..b1f14eae290 100644
--- a/code/modules/mob/living/silicon/robot/emote.dm
+++ b/code/modules/mob/living/silicon/robot/emote.dm
@@ -56,10 +56,9 @@
m_type = 2
if ("custom")
- var/input = input("Choose an emote to display.") as text|null
+ var/input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
if (!input)
return
- input = sanitize(input)
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
if (input2 == "Visible")
m_type = 1
diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm
index 244a980aa81..bbd8b01c36a 100644
--- a/code/modules/mob/new_player/preferences.dm
+++ b/code/modules/mob/new_player/preferences.dm
@@ -391,16 +391,14 @@ datum/preferences
switch(link_tags["real_name"])
if("input")
- new_name = input(user, "Please select a name:", "Character Generation") as text
+ new_name = copytext( (input(user, "Please select a name:", "Character Generation") as text) ,1,MAX_NAME_LEN)
var/list/bad_characters = list("_", "\"", "<", ">", ";", "\[", "\]", "{", "}", "|", "\\","0","1","2","3","4","5","6","7","8","9")
for(var/c in bad_characters)
new_name = dd_replacetext(new_name, c, "")
+
if(!new_name || (new_name == "Unknown") || (new_name == "floor") || (new_name == "wall") || (new_name == "r-wall"))
alert("Invalid name. Don't do that!")
return
- if(length(new_name) >= 26)
- alert("That name is too long.")
- return
//Carn: To fix BYOND text-parsing errors caused by people using dumb capitalisation in their names.
var/tempname
@@ -414,8 +412,6 @@ datum/preferences
randomize_name()
if(new_name)
- if(length(new_name) >= 26)
- new_name = copytext(new_name, 1, 26)
real_name = new_name
if(link_tags["age"])
@@ -429,17 +425,9 @@ datum/preferences
if(link_tags["OOC"])
var/tempnote = ""
- tempnote = input(user, "Please enter your OOC/ERP Notes!:", "OOC notes" , metadata) as text
- var/list/bad_characters = list("_", "\"", "<", ">", ";", "\[", "\]", "{", "}", "|", "\\","0","1","2","3","4","5","6","7","8","9")
-
- for(var/c in bad_characters)
- tempnote = dd_replacetext(tempnote, c, "")
-
- if(length(tempnote) >= 255)
- alert("That name is too long. (255 character max, please)")
- return
-
- metadata = tempnote
+ tempnote = copytext(sanitize(input(user, "Please enter your OOC Notes!:", "OOC notes" , metadata) as text),1,MAX_MESSAGE_LEN)
+ if(tempnote)
+ metadata = tempnote
return
@@ -493,9 +481,9 @@ datum/preferences
if("random")
randomize_skin_tone()
if("input")
- var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation") as text
+ var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation") as num
if(new_tone)
- s_tone = max(min(round(text2num(new_tone)), 220), 1)
+ s_tone = max(min(round(new_tone), 220), 1)
s_tone = -s_tone + 35
if(link_tags["h_style"])
diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm
index e85967c91f8..a29d418424e 100644
--- a/code/modules/paperwork/folders.dm
+++ b/code/modules/paperwork/folders.dm
@@ -35,8 +35,7 @@
user << "\blue You put the [W] into the folder."
update_icon()
else if(istype(W, /obj/item/weapon/pen))
- var/n_name = input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text
- n_name = copytext(n_name, 1, 32)
+ var/n_name = copytext(sanitize(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text),1,MAX_NAME_LEN)
if ((loc == usr && usr.stat == 0))
name = "folder[(n_name ? text("- '[n_name]'") : null)]"
return
diff --git a/code/modules/paperwork/handlabeler.dm b/code/modules/paperwork/handlabeler.dm
index 7aa68d683e8..cec4d27d1e5 100644
--- a/code/modules/paperwork/handlabeler.dm
+++ b/code/modules/paperwork/handlabeler.dm
@@ -40,13 +40,10 @@
if(mode)
usr << "\blue You turn on the hand labeler."
//Now let them chose the text.
- var/str = reject_bad_text(input(usr,"Label text?","Set label","")) //sanitize stuff! GOD DAMN THIS IS A SECURITY HOLE
+ var/str = copytext(reject_bad_text(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
usr << "\red Invalid text."
return
- if(length(str) > 64)
- usr << "\red Text too long."
- return
label = str
usr << "\blue You set the text to '[str]'."
else
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index c291e42c07c..b814cd1295f 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -62,8 +62,7 @@
if ((usr.mutations & CLUMSY) && prob(50))
usr << "\red You cut yourself on the paper."
return
- var/n_name = input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text
- n_name = copytext(n_name, 1, 32)
+ var/n_name = copytext(sanitize(input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text),1,MAX_NAME_LEN)
if ((loc == usr && usr.stat == 0))
name = "paper[(n_name ? text("- '[n_name]'") : null)]"
add_fingerprint(usr)
diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm
index 83513caf51d..a1b8c369624 100644
--- a/code/modules/projectiles/guns/projectile/revolver.dm
+++ b/code/modules/projectiles/guns/projectile/revolver.dm
@@ -26,8 +26,7 @@
M << "\red You don't feel cool enough to name this gun, chump."
return 0
- var/input = input("What do you want to name the gun?",,"")
- input = sanitize(input)
+ var/input = copytext(sanitize(input("What do you want to name the gun?",,"")),1,MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src))
name = input
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 84b87f72e38..b5888001873 100644
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -24,17 +24,13 @@
user << "\blue *TAGGED*"
src.sortTag = O.currTag
else if(istype(W, /obj/item/weapon/pen))
- var/str = input(usr,"Label text?","Set label","")
+ var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
usr << "\red Invalid text."
return
- if(length(str) > 64)
- usr << "\red Text too long."
- return
- var/label = str
for(var/mob/M in viewers())
- M << "\blue [user] labels [src] as [label]."
- src.name = "[src.name] ([label])"
+ M << "\blue [user] labels [src] as [str]."
+ src.name = "[src.name] ([str])"
return
/obj/item/smallDelivery
@@ -64,17 +60,13 @@
user << "\blue *TAGGED*"
src.sortTag = O.currTag
else if(istype(W, /obj/item/weapon/pen))
- var/str = input(usr,"Label text?","Set label","")
+ var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
usr << "\red Invalid text."
return
- if(length(str) > 64)
- usr << "\red Text too long."
- return
- var/label = str
for(var/mob/M in viewers())
- M << "\blue [user] labels [src] as [label]."
- src.name = "[src.name] ([label])"
+ M << "\blue [user] labels [src] as [str]."
+ src.name = "[src.name] ([str])"
return
diff --git a/tgstation.dme b/tgstation.dme
index c241eb01888..d6d9dc1dc5e 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -154,7 +154,6 @@
#define FILE_DIR "code/unused/powerarmor"
#define FILE_DIR "code/unused/spacecraft"
#define FILE_DIR "code/WorkInProgress"
-#define FILE_DIR "code/WorkInProgress/BS12"
#define FILE_DIR "code/WorkInProgress/mapload"
#define FILE_DIR "code/WorkInProgress/organs"
#define FILE_DIR "code/WorkInProgress/virus2"
@@ -605,6 +604,7 @@
#include "code\game\objects\tank.dm"
#include "code\game\objects\toys.dm"
#include "code\game\objects\transfer_valve.dm"
+#include "code\game\objects\uplinks.dm"
#include "code\game\objects\washing_machine.dm"
#include "code\game\objects\watercloset.dm"
#include "code\game\objects\weapons.dm"
@@ -723,6 +723,7 @@
#include "code\game\objects\storage\lockbox.dm"
#include "code\game\objects\storage\storage.dm"
#include "code\game\objects\storage\toolbox.dm"
+#include "code\game\objects\storage\uplink_kits.dm"
#include "code\game\objects\tanks\emergency.dm"
#include "code\game\objects\tanks\jetpack.dm"
#include "code\game\objects\tanks\oxygen.dm"
@@ -1076,8 +1077,6 @@
#include "code\modules\security levels\security levels.dm"
#include "code\WorkInProgress\buildmode.dm"
#include "code\WorkInProgress\explosion_particles.dm"
-#include "code\WorkInProgress\BS12\uplink_kits.dm"
-#include "code\WorkInProgress\BS12\uplinks.dm"
#include "code\WorkInProgress\organs\implants.dm"
#include "code\WorkInProgress\organs\organs.dm"
#include "interface\interface.dm"