diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index 8a3649cb30c..1637f44d6dd 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -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) - log_asset("File not found ([filename])") - return - - var/text = file2text(filename) - if(!text) - log_asset("File empty ([filename])") - return - - return text - /proc/get_subfolders(var/root) var/list/folders = list() var/list/contents = flist(root) diff --git a/code/controllers/subsystems/chemistry.dm b/code/controllers/subsystems/chemistry.dm index fce5cff387e..0dbae42a610 100644 --- a/code/controllers/subsystems/chemistry.dm +++ b/code/controllers/subsystems/chemistry.dm @@ -128,7 +128,7 @@ SUBSYSTEM_DEF(chemistry) return try - chemconfig = json_decode(return_file_text("config/secretchem.json")) + chemconfig = json_decode(file2text("config/secretchem.json")) catch(var/exception/e) log_subsystem_chemistry("Warning: Could not load config, as secretchem.json is missing - [e]") return diff --git a/code/controllers/subsystems/discord.dm b/code/controllers/subsystems/discord.dm index ebaa62c1ddb..7a6a65b706a 100644 --- a/code/controllers/subsystems/discord.dm +++ b/code/controllers/subsystems/discord.dm @@ -68,7 +68,7 @@ SUBSYSTEM_DEF(discord) PRIVATE_PROC(TRUE) if(!SSdbcore.Connect()) log_subsystem_discord("initialize_webhooks - Unable to connect to db - Loading from File") - var/file = return_file_text("config/webhooks.json") + var/file = file2text("config/webhooks.json") if (file) var/jsonData = json_decode(file) if(!jsonData) diff --git a/code/datums/helper_datums/synthsprites.dm b/code/datums/helper_datums/synthsprites.dm index 62ed3a001c0..f78af8967de 100644 --- a/code/datums/helper_datums/synthsprites.dm +++ b/code/datums/helper_datums/synthsprites.dm @@ -31,7 +31,7 @@ paiicon is the pai icon sprite name return try - customsynthsprites = json_decode(return_file_text("config/customsynths.json")) + customsynthsprites = json_decode(file2text("config/customsynths.json")) catch(var/exception/ej) LOG_DEBUG("Error: Warning: Could not load custom synth config, as customsynths.json is missing - [ej]") return diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index 3be54613f8b..bb650bc4599 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -21,7 +21,7 @@ var/list/whitelist_jobconfig = list() if(fexists("config/whitelist_jobconfig.json")) LOG_DEBUG("Whitelist JobConfig: Loading from json") try - whitelist_jobconfig = json_decode(return_file_text("config/whitelist_jobconfig.json")) + whitelist_jobconfig = json_decode(file2text("config/whitelist_jobconfig.json")) catch(var/exception/e) LOG_DEBUG("Whitelist JobConfig: Failed to load whitelist_jobconfig.json: [e]") diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 500d121da56..0b424483271 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -64,7 +64,7 @@ GLOBAL_LIST_INIT(custom_items, list()) var/list/loaded_items = list() var/item_id = 0 try - loaded_items = json_decode(return_file_text("config/custom_items.json")) + loaded_items = json_decode(file2text("config/custom_items.json")) catch(var/exception/e) log_module_customitems("Failed to load custom_items.json: [e]")