I was wanting to see if I could generate a list of available procs using typesof() for a given type, but since text2path() isn't working as expected, that just isn't going to happen without hard-coding the paths for each individual object type.
The strange thing is that "/someobject/proc/someproc" works but just "/someobject/proc" doesn't, which makes me consider this to be a bug, and not just a limitation of text2path().
Numbered Steps to Reproduce Problem:
1. Compile and run this code:
mob/proc/someproc()
mob/verb/checkpath()
if(text2path("[type]/proc"))
src << "text2path() worked for /mob/proc"
else
src << "text2path() failed at /mob/proc"
if(text2path("[type]/proc/someproc"))
src << "text2path() worked for /mob/proc/someproc"
else
src << "text2path() failed at /mob/proc/someproc"
2. Click the checkpath verb and see how the /proc path fails; yet it works for an individual proc.
Expected Results:
text2path() successfully generates /proc and /verb paths.
Actual Results:
text2path() returns null for /proc and /verb paths.
Workarounds:
Do something terrible like this for every single object:
mob
var
procpath = /mob/proc
verbpath = /mob/verb
I hope this gets fixed. The inconsistency is very annoying.
I think it's a little-documented (if at all) feature that type paths can sometimes be given as text to some built-in procs.