mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
browse_files() now allows transfer of .json files (#15411)
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
for(var/file in args)
|
||||
src << browse_rsc(file)
|
||||
|
||||
/client/proc/browse_files(root="data/logs/", max_iterations=10, list/valid_extensions=list(".txt",".log",".htm"))
|
||||
/client/proc/browse_files(root="data/logs/", max_iterations=10, list/valid_extensions=list("txt", "log", "htm", "json"))
|
||||
// wow why was this ever a parameter
|
||||
root = "data/logs/"
|
||||
var/path = root
|
||||
@@ -39,7 +39,8 @@
|
||||
if(copytext(path,-1,0) != "/") //didn't choose a directory, no need to iterate again
|
||||
break
|
||||
|
||||
var/extension = copytext(path,-4,0)
|
||||
var/list/exploded = splittext(path, ".")
|
||||
var/extension = exploded[length(exploded)]
|
||||
if( !fexists(path) || !(extension in valid_extensions) )
|
||||
to_chat(src, "<font color='red'>Error: browse_files(): File not found/Invalid file([path]).</font>")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user