diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 840631ba791..096eb0128b0 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -40,7 +40,12 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that switch(alert("Proc owned by something?",,"Yes","No")) if("Yes") targetselected = 1 - class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client") + if(src.holder && src.holder.marked_datum) + class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client","Marked datum ([holder.marked_datum.type])") + if(class == "Marked datum ([holder.marked_datum.type])") + class = "Marked datum" + else + class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client") switch(class) if("Obj") target = input("Enter target:","Target",usr) as obj in world @@ -53,6 +58,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that for(var/client/C) keys += C target = input("Please, select a player!", "Selection", null, null) as null|anything in keys + if("Marked datum") + target = holder.marked_datum else return if("No") @@ -62,6 +69,10 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that var/procname = input("Proc path, eg: /proc/fake_blood","Path:", null) as text|null if(!procname) return + if(targetselected && !hascall(target,procname)) + usr << "Error: callproc(): target has no such call [procname]." + return + var/list/lst = get_callproc_args() if(!lst) return @@ -70,9 +81,6 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if(!target) usr << "Error: callproc(): owner of proc no longer exists." return - if(!hascall(target,procname)) - usr << "Error: callproc(): target has no such call [procname]." - return log_admin("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].") returnval = call(target,procname)(arglist(lst)) // Pass the lst as an argument list to the proc else @@ -94,6 +102,10 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if(!procname) return + if(!hascall(A,procname)) + usr << "Error: callproc_datum(): target has no such call [procname]." + return + var/list/lst = get_callproc_args() if(!lst) return @@ -101,9 +113,6 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if(!A || !IsValidSrc(A)) usr << "Error: callproc_datum(): owner of proc no longer exists." return - if(!hascall(A,procname)) - usr << "Error: callproc_datum(): target has no such call [procname]." - return log_admin("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].") spawn() @@ -122,8 +131,14 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that //this will protect us from a fair few errors ~Carn while(argnum--) + var/class = null // Make a list with each index containing one variable, to be given to the proc - var/class = input("What kind of variable?","Variable Type") in list("text","num","type","reference","mob reference","icon","file","client","mob's area","CANCEL") + if(src.holder && src.holder.marked_datum) + class = input("What kind of variable?","Variable Type") in list("text","num","type","reference","mob reference","icon","file","client","mob's area","Marked datum ([holder.marked_datum.type])","CANCEL") + if(holder.marked_datum && class == "Marked datum ([holder.marked_datum.type])") + class = "Marked datum" + else + class = input("What kind of variable?","Variable Type") in list("text","num","type","reference","mob reference","icon","file","client","mob's area","CANCEL") switch(class) if("CANCEL") return null @@ -158,6 +173,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if("mob's area") var/mob/temp = input("Select mob", "Selection", usr) as mob in world lst += temp.loc + + if("Marked datum") + lst += holder.marked_datum return lst /client/proc/Cell()