diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index c8d798532c..c1f32f45db 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -1664,20 +1664,35 @@ GLOBAL_REAL_VAR(list/stack_trace_storage) set waitfor = FALSE return call(source, proctype)(arglist(arguments)) -/proc/whatIsThis(var/datum/D) +/proc/describeThis(var/datum/D) if(istype(D)) - return "It is a datum of type [D.type] - [D]" + var/msg = "[D.type] - [D]" + if(isatom(D)) + var/atom/A = D + if(!A.z) + msg += " - Coords unavailable (in contents?)" + if(ismovable(A)) + var/turf/T = get_turf(A) + if(T) + msg += " - Parent turf: [T.x],[T.y],[T.z]" + else + msg += " - In nullspace" + else + msg += " - In nullspace" + else + msg += "- [A.x],[A.y],[A.z]" + return msg else if(isnull(D)) - return "It is a NULL" + return "NULL" else if(istext(D)) - return "It is TEXT: [D]" + return "TEXT: [D]" else if(isnum(D)) - return "It is NUM: [D]" + return "NUM: [D]" else if(ispath(D)) - return "It is PATH: [D]" + return "PATH: [D]" else if(islist(D)) - return "It is a LIST: [D]" + return "LIST: [D]" else if(isclient(D)) - return "It is a CLIENT: [D]" + return "CLIENT: [D]" else return "Unknown data type: [D]" diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm index 189f9183bb..6b6c345b24 100644 --- a/code/controllers/subsystem.dm +++ b/code/controllers/subsystem.dm @@ -220,13 +220,13 @@ // an opportunity to clean up the subsystem or check it for errors in ways that would otherwise be too slow. // You should log the errors/cleanup results, so you can fix the problem rather than using this as a crutch. /datum/controller/subsystem/proc/fail() - var/msg = "[name] subsystem being blamed for MC failure, continuing operation." + var/msg = "[name] subsystem being blamed for MC failure" log_world(msg) log_game(msg) // DO NOT ATTEMPT RECOVERY. Only log debugging info. You should leave the subsystem as it is. // Attempting recovery here could make things worse, create hard recursions with the MC disabling it every run, etc. /datum/controller/subsystem/proc/critfail() - var/msg = "[name] subsystem received final blame for MC failure, considered beyond recovery, and no longer firing." + var/msg = "[name] subsystem received final blame for MC failure" log_world(msg) log_game(msg) diff --git a/code/controllers/subsystems/mobs.dm b/code/controllers/subsystems/mobs.dm index 1f57eaa1e5..b44b9ac5d6 100644 --- a/code/controllers/subsystems/mobs.dm +++ b/code/controllers/subsystems/mobs.dm @@ -56,18 +56,18 @@ SUBSYSTEM_DEF(mobs) var/msg = "Debug output from the [name] subsystem:\n" msg += "- This subsystem is processed tail-first -\n" if(!currentrun || !mob_list) - msg += "ERROR: A critical list [currentrun ? 'mob_list' : 'currentrun'] is gone!" + msg += "ERROR: A critical list [currentrun ? "mob_list" : "currentrun"] is gone!" log_game(msg) - log_server(msg) + log_world(msg) return - msg += "Lists: current_run: [currentrun.len], mob_list: [mob_list.len]\n" + msg += "Lists: currentrun: [currentrun.len], mob_list: [mob_list.len]\n" if(!currentrun.len) msg += "!!The subsystem just finished the mob_list list, and currentrun is empty (or has never run).\n" msg += "!!The info below is the tail of mob_list instead of currentrun.\n" var/datum/D = currentrun.len ? currentrun[currentrun.len] : mob_list[mob_list.len] - msg += "Tail entry: [whatIsThis(D)] (this is likely the item AFTER the problem item)\n" + msg += "Tail entry: [describeThis(D)] (this is likely the item AFTER the problem item)\n" var/position = mob_list.Find(D) if(!position) @@ -81,16 +81,16 @@ SUBSYSTEM_DEF(mobs) var/end = clamp(position+2,1,mob_list.len) msg += "2 previous elements, then tail, then 2 next elements of mob_list list for context:\n" msg += "---\n" - for(var/i in start to finish) - msg += "[whatIsThis([mob_list[i])]\n" + for(var/i in start to end) + msg += "[describeThis(mob_list[i])][i == position ? " << TAIL" : ""]\n" msg += "---\n" log_game(msg) - log_server(msg) + log_world(msg) -/datum/controller/subsystem/processing/fail() +/datum/controller/subsystem/mobs/fail() ..() log_recent() -/datum/controller/subsystem/processing/critfail() +/datum/controller/subsystem/mobs/critfail() ..() log_recent() \ No newline at end of file diff --git a/code/controllers/subsystems/processing/processing.dm b/code/controllers/subsystems/processing/processing.dm index a155d357cf..a16902c0c5 100644 --- a/code/controllers/subsystems/processing/processing.dm +++ b/code/controllers/subsystems/processing/processing.dm @@ -64,9 +64,9 @@ SUBSYSTEM_DEF(processing) var/msg = "Debug output from the [name] subsystem:\n" msg += "- Process subsystems are processed tail-first -\n" if(!currentrun || !processing) - msg += "ERROR: A critical list [currentrun ? 'processing' : 'currentrun'] is gone!" + msg += "ERROR: A critical list [currentrun ? "processing" : "currentrun"] is gone!" log_game(msg) - log_server(msg) + log_world(msg) return msg += "Lists: current_run: [currentrun.len], processing: [processing.len]\n" @@ -75,7 +75,7 @@ SUBSYSTEM_DEF(processing) msg += "!!The info below is the tail of processing instead of currentrun.\n" var/datum/D = currentrun.len ? currentrun[currentrun.len] : processing[processing.len] - msg += "Tail entry: [whatIsThis(D)] (this is likely the item AFTER the problem item)\n" + msg += "Tail entry: [describeThis(D)] (this is likely the item AFTER the problem item)\n" var/position = processing.Find(D) if(!position) @@ -89,11 +89,11 @@ SUBSYSTEM_DEF(processing) var/end = clamp(position+2,1,processing.len) msg += "2 previous elements, then tail, then 2 next elements of processing list for context:\n" msg += "---\n" - for(var/i in start to finish) - msg += "[whatIsThis([processing[i])]\n" + for(var/i in start to end) + msg += "[describeThis(processing[i])][i == position ? " << TAIL" : ""]\n" msg += "---\n" log_game(msg) - log_server(msg) + log_world(msg) /datum/controller/subsystem/processing/fail() ..()