mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 21:19:00 +01:00
Some fixes for topic calls and inputs.
There's like 1001 things to fix so some of this is somewhat crude for now. new helper proc located in procs/helpers.dm reject_bad_text(var/text) just feed any text in and it will either return the original text or null (if it contains odd characters such as \ / < > or characters reserved by BYOND. It also rejects if there are no non-whitespace characters) git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3571 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -206,6 +206,7 @@
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
usr.machine = src
|
||||
if(!beaker) return
|
||||
var/datum/reagents/R = beaker:reagents
|
||||
@@ -259,18 +260,18 @@
|
||||
reagents.clear_reagents()
|
||||
icon_state = "mixer0"
|
||||
else if (href_list["createpill"])
|
||||
var/name = input(usr,"Name:","Name your pill!",reagents.get_master_reagent_name())
|
||||
var/name = reject_bad_text(input(usr,"Name:","Name your pill!",reagents.get_master_reagent_name()))
|
||||
var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc)
|
||||
if(!name || name == " ") name = reagents.get_master_reagent_name()
|
||||
if(!name) name = reagents.get_master_reagent_name()
|
||||
P.name = "[name] pill"
|
||||
P.pixel_x = rand(-7, 7) //random position
|
||||
P.pixel_y = rand(-7, 7)
|
||||
reagents.trans_to(P,50)
|
||||
else if (href_list["createbottle"])
|
||||
if(!condi)
|
||||
var/name = input(usr,"Name:","Name your bottle!",reagents.get_master_reagent_name())
|
||||
var/name = reject_bad_text(input(usr,"Name:","Name your bottle!",reagents.get_master_reagent_name()))
|
||||
var/obj/item/weapon/reagent_containers/glass/bottle/P = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
|
||||
if(!name || name == " ") name = reagents.get_master_reagent_name()
|
||||
if(!name) name = reagents.get_master_reagent_name()
|
||||
P.name = "[name] bottle"
|
||||
P.pixel_x = rand(-7, 7) //random position
|
||||
P.pixel_y = rand(-7, 7)
|
||||
@@ -281,7 +282,6 @@
|
||||
else
|
||||
usr << browse(null, "window=chem_master")
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
|
||||
+1
-16
@@ -582,27 +582,12 @@
|
||||
if(src:cameraFollow)
|
||||
src:cameraFollow = null
|
||||
|
||||
|
||||
/client/Topic(href, href_list)
|
||||
if(href_list["priv_msg"])
|
||||
var/client/C = locate(href_list["priv_msg"])
|
||||
if(ismob(C)) //Old stuff can pass in mobs instead of clients
|
||||
var/mob/M = C
|
||||
C = M.client
|
||||
cmd_admin_pm(C,null)
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/Topic(href, href_list)
|
||||
if(href_list["priv_msg"]) //for priv_msg references that have yet to be updated to target clients. Forwards it to client/Topic()
|
||||
if(client)
|
||||
client.Topic(href, href_list)
|
||||
|
||||
if(href_list["mach_close"])
|
||||
var/t1 = text("window=[href_list["mach_close"]]")
|
||||
machine = null
|
||||
src << browse(null, t1)
|
||||
..()
|
||||
// ..()
|
||||
return
|
||||
|
||||
/mob/proc/get_damage()
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
if(mode)
|
||||
usr << "\blue You turn on the hand labeler."
|
||||
//Now let them chose the text.
|
||||
var/str = input(usr,"Label text?","Set label","")
|
||||
var/str = reject_bad_text(input(usr,"Label text?","Set label","")) //sanitize stuff! GOD DAMN THIS IS A SECURITY HOLE
|
||||
if(!str || !length(str))
|
||||
usr << "\red Invalid text."
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user