mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
>We still let old code in the codebase (#26506)
This commit is contained in:
@@ -1,17 +1,3 @@
|
|||||||
//checks if a file exists and contains text
|
|
||||||
//returns text as a string if these conditions are met
|
|
||||||
/proc/return_file_text(filename)
|
|
||||||
if(fexists(filename) == 0)
|
|
||||||
throw EXCEPTION("return_file_text(): File not found")
|
|
||||||
return
|
|
||||||
|
|
||||||
var/text = file2text(filename)
|
|
||||||
if(!text)
|
|
||||||
throw EXCEPTION("return_file_text(): File empty")
|
|
||||||
return
|
|
||||||
|
|
||||||
return text
|
|
||||||
|
|
||||||
//Sends resource files to client cache
|
//Sends resource files to client cache
|
||||||
/client/proc/getFiles()
|
/client/proc/getFiles()
|
||||||
for(var/file in args)
|
for(var/file in args)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
|
|
||||||
//Splits the text of a file at seperator and returns them in a list.
|
//Splits the text of a file at seperator and returns them in a list.
|
||||||
/proc/file2list(filename, seperator="\n")
|
/proc/file2list(filename, seperator="\n")
|
||||||
return splittext(return_file_text(filename),seperator)
|
return splittext(file2text(filename),seperator)
|
||||||
|
|
||||||
|
|
||||||
//Turns a direction into text
|
//Turns a direction into text
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ SUBSYSTEM_DEF(job)
|
|||||||
|
|
||||||
|
|
||||||
/datum/controller/subsystem/job/proc/LoadJobs()
|
/datum/controller/subsystem/job/proc/LoadJobs()
|
||||||
var/jobstext = return_file_text("config/jobs.txt")
|
var/jobstext = file2text("config/jobs.txt")
|
||||||
for(var/datum/job/J in occupations)
|
for(var/datum/job/J in occupations)
|
||||||
var/regex/jobs = new("[J.title]=(-1|\\d+),(-1|\\d+)")
|
var/regex/jobs = new("[J.title]=(-1|\\d+),(-1|\\d+)")
|
||||||
jobs.Find(jobstext)
|
jobs.Find(jobstext)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
var/date
|
var/date
|
||||||
|
|
||||||
/datum/getrev/New()
|
/datum/getrev/New()
|
||||||
var/head_file = return_file_text(".git/logs/HEAD")
|
var/head_file = file2text(".git/logs/HEAD")
|
||||||
if(SERVERTOOLS && fexists("..\\prtestjob.lk"))
|
if(SERVERTOOLS && fexists("..\\prtestjob.lk"))
|
||||||
var/list/tmp = file2list("..\\prtestjob.lk")
|
var/list/tmp = file2list("..\\prtestjob.lk")
|
||||||
for(var/I in tmp)
|
for(var/I in tmp)
|
||||||
|
|||||||
Reference in New Issue
Block a user