Fixes NTSL scripts not working (#16351)

* Fixes NTSL scripts from not working.

* Removes a runtime caused by previous code.

* removes old message in favor of previous one in commit

* Requested changes

* Update IDE.dm
This commit is contained in:
BurgerLUA
2022-11-10 20:13:50 -08:00
committed by GitHub
parent 0d0550571e
commit c071763b67
3 changed files with 24 additions and 12 deletions

View File

@@ -67,7 +67,7 @@
//Returns null if there is any bad text in the string
/proc/reject_bad_text(text, max_length = 512, ascii_only = TRUE, require_pretty=TRUE)
/proc/reject_bad_text(text, max_length = 512, ascii_only = TRUE, require_pretty=TRUE, allow_newline=FALSE, allow_code=FALSE)
if(require_pretty && isnotpretty(text))
return
var/char_count = 0
@@ -80,9 +80,17 @@
if(char_count > max_length)
return
switch(text2ascii(char))
if(62, 60, 92, 47) // <, >, \, /
if(9, 62, 60, 92, 47) // tab, <, >, \, /
if(!allow_code)
return
if(10, 13) //Carriage returns (CR) and newline (NL)
if(!allow_newline)
return
if(0 to 8)
return
if(0 to 31)
if(11, 12)
return
if(14 to 31)
return
if(32)
continue