diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 520d92e914c..cc04962c1f5 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -92,8 +92,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that log_admin("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].") message_admins("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].") returnval = call(procname)(arglist(lst)) // Pass the lst as an argument list to the proc - - usr << "[procname] returned: [returnval ? returnval : "null"]" + . = get_callproc_returnval(returnval, procname) + if(.) + usr << . feedback_add_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/callproc_datum(A as null|area|mob|obj|turf) @@ -122,7 +123,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that feedback_add_details("admin_verb","DPC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! var/returnval = call(A,procname)(arglist(lst)) // Pass the lst as an argument list to the proc - usr << "[procname] returned: [returnval ? returnval : "null"]" + . = get_callproc_returnval(returnval,procname) + if(.) + usr << . @@ -183,6 +186,30 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that return lst +/client/proc/get_callproc_returnval(returnval,procname) + . = "" + if(islist(returnval)) + var/list/returnedlist = returnval + . = "" + if(returnedlist.len) + var/assoc_check = returnedlist[1] + if(istext(assoc_check) && (returnedlist[assoc_check] != null)) + . += "[procname] returned an associative list:" + for(var/key in returnedlist) + . += "\n[key] = [returnedlist[key]]" + + else + . += "[procname] returned a list:" + for(var/elem in returnedlist) + . += "\n[elem]" + else + . = "[procname] returned an empty list" + . += "" + + else + . = "[procname] returned: [returnval ? returnval : "null"]" + + /client/proc/Cell() set category = "Debug" set name = "Air Status in Location"