/
LIB3/
LIB3/D/ADMIN/
LIB3/D/ADMIN/OBJ/
LIB3/D/ADMIN/ROOM/W/
LIB3/D/HOME/
LIB3/D/HOME/CITY/ARENA/
LIB3/D/HOME/CITY/ITEMS/
LIB3/D/HOME/CITY/POSTOFFI/
LIB3/DOC/
LIB3/GLOBAL/SPECIAL/
LIB3/GLOBAL/VIRTUAL/
LIB3/NET/
LIB3/NET/CONFIG/
LIB3/NET/DAEMON/CHARS/
LIB3/NET/GOPHER/
LIB3/NET/INHERIT/
LIB3/NET/OBJ/
LIB3/NET/SAVE/
LIB3/NET/VIRTUAL/
LIB3/OBJ/B_DAY/
LIB3/OBJ/HANDLERS/TERM_TYP/
LIB3/PLAYERS/B/
LIB3/PLAYERS/N/
LIB3/ROOM/
LIB3/SAVE/
LIB3/SAVE/BOARDS/
LIB3/SAVE/ENVIRON/
LIB3/SAVE/POST/
LIB3/STD/COMMANDS/SHADOWS/
LIB3/STD/CREATOR/
LIB3/STD/DOM/
LIB3/STD/EFFECTS/
LIB3/STD/EFFECTS/HEALING/
LIB3/STD/EFFECTS/OTHER/
LIB3/STD/EFFECTS/POISONS/
LIB3/STD/ENVIRON/
LIB3/STD/GUILDS/
LIB3/STD/LIQUIDS/
LIB3/STD/ROOM/
LIB3/STD/TRIGGER/SHADOW/
LIB3/W/
LIB3/W/BANNOR/
LIB3/W/NEWSTYLE/
static mixed *rest;

/* If anyone can tell me what this does...
 * I would be most apprecative, Pinkfish... Yes yes ok i did write it.
 */
find_match( string str, mixed ob )
{
    mixed  *array, test, *ret;
    int     i, num, top, bot, bing, j;
    string  nick, type, *bits;
    mapping rabbit;

    if( !ob || intp( ob ) )
	return({ });
    if( str == "" || !str )
	return({ });
    if( stringp( ob ) )
    {
	ob->dummy();
	ob = find_object( ob );
    }
    if( !pointerp( ob ) )
    {
	ob = (mixed)ob->find_inv_match( str );
	if( !ob )
	    return({ });
    }
    else
    {
	array = ({ });
	for( i = 0; i < sizeof( ob ); i++ )
	    if( (test = (object *)ob[ i ]->find_inv_match( str )) )
		array += test;
	ob = array;
    }
    bits = explode( implode( explode( str, " and " ), "," ), "," );
    ret = ({ });
    for( j = 0; j < sizeof( bits ); j++ )
    {
	str = bits[ j ];
	nick = (string)this_object()->expand_nickname( str );
	if( !nick && this_player() )
	    nick = (string)this_player()->expand_nickname( str );
	if( nick && nick != "" )
	    str = nick;
	if( str == "it" || str == "them" || str == "him" || str == "her" )
	{
	    rest = all_inventory( this_player() ) +
		all_inventory( environment( this_player() ) );
	    array = (object *)this_player()->query_it_them();
	    while( i < sizeof( array ) )
		if( member_array( array[ i ], rest ) == -1 )
		    array = delete( array, i, 1 );
		else
		    i++;
	    if( !sizeof( array ) )
		continue;
	    if( str == "it" )
	    {
		ret += array[ 0..0 ];
		continue;
	    }
	    if( str == "her" )
		if( living( array[ 0 ] ) && (int)array[ 0 ]->query_gender() == 2 )
		{
		    ret += array[ 0..0 ];
		    continue;
		}
		else
		    continue;
	    if( str == "him" )
		if( living( array[ 0 ] ) && (int)array[ 0 ]->query_gender() == 1 )
		{
		    ret += array[ 0..0 ];
		    continue;
		}
		else
		    continue;
	    ret += array;
	    continue;
	}
	test = explode( str, " " );
	sscanf( test[ sizeof( test ) - 1 ], "%d", bing );
	test = ({ });
	rest = ({ });
	if( sscanf( str, "%d/%d of %s", top, bot, str ) != 3 )
	    top = bot = 1;
	if( top <= 0 )
	    top = 1;
	if( bot < top )
	    bot = top;
	parse_command( str, ob, "%i", test );
	if( !test || !sizeof( test ) )
	    continue;
	if( bot != top )
	{
	    num = test[ 0 ];
	    rabbit = ([ ]);
	    for( i = 1; i < sizeof( test ); i++ )
		rabbit[ test[ i ] ] = 1;
	    array = query_strange_inventory( keys( rabbit ) );
	    test = ({ });
	    for( i = 0; i < sizeof( array ); i += 2 )
		test += map_array( array[ i + 1 ], "query_frac_simul_efun_id",
				   this_object(), ({ num, str, 0, sizeof( array[ i + 1 ] ),
						     top, bot }) );
	    array = test + rest;
	    ret += array;
	    continue;
	}
	if( test[ 0 ] == 1 && bing )
	    test[ 0 ] = -bing;
	rabbit = ([ ]);
	for( i = 1; i < sizeof( test ); i++ )
	    rabbit[ test[ i ] ] = 1;
	array = map_array( keys( rabbit ), "query_simul_efun_id",
			   this_object(), ({ test[ 0 ], str }) );
	array += rest;
	ret += array;
    }
    if( this_player() && sizeof( ret ) )
	return this_player()->set_it_them( ret - ({ 0 }) );
    return ret - ({ 0 });
}				/* find_match() */

object  query_simul_efun_id( object ob, mixed *arr )
{
    mixed   ret;

    ret = (mixed)ob->query_parse_id( arr );
    if( !pointerp( ret ) )
	return ret;
    rest += ret[ 1..sizeof( ret ) ];
    return ret[ 0 ];
}				/* query_simul_efun_id() */

object  query_frac_simul_efun_id( object ob, mixed *arr )
{
    mixed   ret;

    ret = (mixed)ob->query_frac_parse_id( arr );
    if( !pointerp( ret ) )
	return ret;
    rest += ret[ 1..sizeof( ret ) ];
    return ret[ 0 ];
}				/* query_frac_efun_id() */

int     fixup_parse_command( mixed ob )
{
    return objectp( ob );
}				/* fixup_parse_command() */