/*
Copyright (C) 1991, Marcus J. Ranum. All rights reserved.
*/
#ifndef lint
static char RCSid[] = "$Header: /home/mjr/hacks/umud/CMD/RCS/inv.c,v 1.1 92/02/09 22:59:28 mjr Exp $";
#endif
/* configure all options BEFORE including system stuff. */
#include "config.h"
#include "mud.h"
#include "match.h"
#include "vars.h"
/*
TinyMUD-like "inventory"
*/
static int
inv_thing(who,ac,av)
char *who;
int ac;
char **av;
{
int x;
char ob[MAXOID];
for(x = 0; x < ac; x++) {
if(matchinv(who,av[x],1,MTCH_UNIQ,ob))
continue;
say(who,ut_name(ob),"\n",(char *)0);
}
return(UERR_NONE);
}
/* ARGSUSED */
cmd_inv(argc,argv,who,aswho)
int argc;
char *argv[];
char *who;
char *aswho;
{
if(argc > 1)
return(inv_thing(who,argc - 1,argv + 1));
/* dump things in hand */
if(say_attribute(who,who,var_cont,"You are carrying",0))
say(who,"You aren't carrying anything.\n",(char *)0);
(void)say_attribute(who,who,var_using,"You are holding",0);
return(UERR_NONE);
}