@verb #1247:"path_between" this none this rxdo #8219 @program #1247:"path_between" this none this "Copied from Room Database (#73):path_between by Slacker (#55) Sep 9 22:48:32 2002" "Copied from MattC (#9466):path_between Jun 12 19:26:06 1999" ":path_between(SRC, DEST, OBJ) => {exit1, exit2, ...}" "" "Determines a path from SRC room to DEST room for OBJ, if one exists. Returns simply a list of exits or E_NACC if none exists." {src, dest, object} = args if (src == dest) return {} elseif (!valid(src) || !valid(dest)) raise(E_INVARG) endif stack = {src} pstack = {{}} ostack = {} opstack = {} while (1) end = length(stack) ostack[1..0] = stack opstack[1..0] = pstack stack = {} pstack = {} for i in [1..end] o = ostack[i] path = opstack[i] for e in (`o:exits() ! ANY => {}') suspend(0) " if ((($room_db:valid_exit(e) && $get_property(e, \"obvious\")) && `$call_verb(e, \"is_unlocked_for\", {object}) ! ANY') && `(d = `$call_verb(e, \"real_dest\", {}) ! ANY => $get_property(e, \"dest\")'):acceptable(object) ! ANY')" if (1) d = `$call_verb(e, "real_dest", {}) ! ANY => $get_property(e, "dest")' npath = {@path, e} if (d == dest) return npath endif if (!(d in ostack) && !(d in stack)) stack[1..0] = {d} pstack[1..0] = {npath} endif endif $command_utils:suspend_if_needed() endfor $command_utils:suspend_if_needed() endfor if (!stack) return E_NACC endif endwhile "Last modified by Avenger (#8219) on Mon Sep 9 22:57:21 2002 MDT." .