Ejemplo n.º 1
0
void match_list(dbref first, int local)
{
    char *namebuf;

    if (md.confidence >= CON_DBREF) {
	return;
    }

    DOLIST(first, first) {
	if (first == md.absolute_form) {
	    promote_match(first, CON_DBREF | local);
	    return;
	}

	/*
	 * Warning: make sure there are no other calls to Name() in
	 * promote_match or its called subroutines; they
	 * would overwrite Name()'s static buffer which is
	 * needed by string_match().
	 */
	namebuf = (char *) PureName(first);

	if (!string_compare(namebuf, md.string)) {
	    promote_match(first, CON_COMPLETE | local);
	} else if (string_match(namebuf, md.string)) {
	    promote_match(first, local);
	}
    }
}
Ejemplo n.º 2
0
void match_here(void)
{
    if (md.confidence >= CON_DBREF)
    {
        return;
    }
    if (  Good_obj(md.player)
       && Has_location(md.player))
    {
        dbref loc = Location(md.player);
        if (Good_obj(loc))
        {
            if (loc == md.absolute_form)
            {
                promote_match(loc, CON_DBREF | CON_LOCAL);
            }
            else if (!string_compare(md.string, T("here")))
            {
                promote_match(loc, CON_TOKEN | CON_LOCAL);
            }
            else if (!string_compare(md.string, PureName(loc)))
            {
                promote_match(loc, CON_COMPLETE | CON_LOCAL);
            }
        }
    }
}
Ejemplo n.º 3
0
UTF8 *unparse_object_numonly(dbref target)
{
    UTF8 *buf = alloc_lbuf("unparse_object_numonly");
    if (target < 0)
    {
        mux_strncpy(buf, aszSpecialDBRefNames[-target], LBUF_SIZE-1);
    }
    else if (!Good_obj(target))
    {
        mux_sprintf(buf, LBUF_SIZE, T("*ILLEGAL*(#%d)"), target);
    }
    else
    {
        mux_sprintf(buf, LBUF_SIZE, T("%s(#%d)"), PureName(target), target);
    }
    return buf;
}
Ejemplo n.º 4
0
static bool match_exit_internal(dbref loc, dbref baseloc, int local)
{
    if (  !Good_obj(loc)
       || !Has_exits(loc))
    {
        return true;
    }

    dbref exit;
    bool result = false;
    int key;

    DOLIST(exit, Exits(loc))
    {
        if (exit == md.absolute_form)
        {
            key = 0;
            if (Examinable(md.player, loc))
            {
                key |= VE_LOC_XAM;
            }
            if (Dark(loc))
            {
                key |= VE_LOC_DARK;
            }
            if (Dark(baseloc))
            {
                key |= VE_BASE_DARK;
            }
            if (exit_visible(exit, md.player, key))
            {
                promote_match(exit, CON_DBREF | local);
                return true;
            }
        }
        if (matches_exit_from_list(md.string, PureName(exit)))
        {
            promote_match(exit, CON_COMPLETE | local);
            result = true;
        }
    }
    return result;
}