Method code for $builder.teleport_cmd()

[Turn on line numbering]
arg cmdstr, com, dest;
var loc, p;

(> .perms(caller(), 'command) <);
if (!dest) {
    .tell("Specify a destination.");
    return;
}
if (dest == "home")
    loc = .home();
else
    loc = (| .match_environment(dest) |);

// if we have still not found a location...
if (!loc) {
    catch any {
        loc = $place_db.search(dest);
    } with {
        switch (error()) {
            case ~ambig:
                .tell("Several rooms match that name: " + traceback()[1][3].mmap('namef).to_english());
            case ~namenf:
                .tell("Unable to find place \"" + dest + "\".");
                return;
            default:
                return traceback()[1][2];
        }
    }
}
if (!loc) {
    .tell("Unable to find place \"" + dest + "\".");
    return;
}
if (loc == .location()) {
    .tell("You are already there!");
    return;
}
if (!.teleport(loc))
    .tell("Sorry.");

["// Created 26-Mar-1995 as a part of ColdCore, see: @help Credit"]

the Cold Dark