[Package Index | Mudlib Index | Effect Index]
File /obj/handlers/route_handler.c
Figures out the route between two destinations for an npc to travel.Written by Wodan
Method index
- get_route(string, string, function)
Try and figure out a route between two locations.
Public Functions
These are functions that everyone can access.
-
get_route
varargs void get_route(string end,
string start,
function call_back)
Try and figure out a route between two locations. It figures out
the route bwteen the two locations and then calls the
call_back function with the found route, or not found route.
If the route is not found, an empty array will be returend. The
function in the npc object move_me_to() handles the call
to this function transparently.
- Parameters:
end - the end location
start - where to start from
call_back - the function to call when finished
- See also:
/obj/monster->move_me_to()
- Example:
// Find how to get from here back to the drum.
// Then print the route out.
ROUTE_HANDLER->get_route("/d/am/am/mendeddrum",
file_name(environment(this_object())),
(: printf("%O\n", $1) :));