From 816f94bd61fd9bdc5f5ec2a9b512e7fb29b6fe02 Mon Sep 17 00:00:00 2001 From: Artur Date: Mon, 10 Feb 2020 10:20:57 +0200 Subject: [PATCH] pandemic fixes --- code/__HELPERS/text.dm | 8 +++++++- code/datums/diseases/advance/symptoms/heal.dm | 8 +++++--- code/modules/reagents/chemistry/machinery/pandemic.dm | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 3985659b71..beb005b8d1 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -44,6 +44,12 @@ index = findtext(t, char, index + length(char)) return t +/proc/sanitize_name(t,list/repl_chars = null) + if(t == "space" || t == "floor" || t == "wall" || t == "r-wall" || t == "monkey" || t == "unknown" || t == "inactive ai") //prevents these common metagamey names + alert("Invalid name.") + return "" + return sanitize(t) + /proc/sanitize_filename(t) return sanitize_simple(t, list("\n"="", "\t"="", "/"="", "\\"="", "?"="", "%"="", "*"="", ":"="", "|"="", "\""="", "<"="", ">"="")) @@ -775,4 +781,4 @@ GLOBAL_LIST_INIT(binary, list("0","1")) #define is_alpha(X) ((text2ascii(X) <= 122) && (text2ascii(X) >= 97)) -#define is_digit(X) ((length(X) == 1) && (length(text2num(X)) == 1)) \ No newline at end of file +#define is_digit(X) ((length(X) == 1) && (length(text2num(X)) == 1)) diff --git a/code/datums/diseases/advance/symptoms/heal.dm b/code/datums/diseases/advance/symptoms/heal.dm index cf14da36a0..c7b9758bcb 100644 --- a/code/datums/diseases/advance/symptoms/heal.dm +++ b/code/datums/diseases/advance/symptoms/heal.dm @@ -448,9 +448,11 @@ symptom_delay_max = 1 passive_message = "Your skin glows faintly for a moment." var/cellular_damage = FALSE - threshold_desc = "Transmission 6: Additionally heals cellular damage and toxin lovers.
\ - Resistance 7: Increases healing speed." - + threshold_desc = list( + "Transmission 6" = "Additionally heals cellular damage and toxin lovers.", + "Resistance 7" = "Increases healing speed.", + ) + /datum/symptom/heal/radiation/Start(datum/disease/advance/A) if(!..()) return diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index bba5371ef8..8870ef8ed5 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -170,7 +170,7 @@ if(!A.mutable) return if(A) - var/new_name = stripped_input(usr, "Name the disease", "New name", "", MAX_NAME_LEN) + var/new_name = sanitize_name(html_encode(params["name"])) if(!new_name || ..()) return A.AssignName(new_name)