/*
Copyright (C) 1991, Marcus J. Ranum. All rights reserved.
*/
#ifndef lint
static char RCSid[] = "$Header: /home/mjr/hacks/umud/CMD/RCS/_dump.c,v 1.1 92/02/09 22:59:27 mjr Exp $";
#endif
/* configure all options BEFORE including system stuff. */
#include "config.h"
#include <stdio.h>
#include "mud.h"
#include "match.h"
#include "vars.h"
/*
dump an object to the player in OIF format
*/
/* ARGSUSED */
cmd__dump(argc,argv,who,aswho)
int argc;
char *argv[];
char *who;
char *aswho;
{
Obj *op;
int xx;
char ob[MAXOID];
int wiz;
wiz = ut_flagged(aswho,var_wiz);
for(xx = 1; xx < argc; xx++ ) {
if(matchlocal(who,argv[xx],ut_loc(who),MTCH_UNIQ|MTCH_MEOK|MTCH_NONLOC,ob))
continue;
if(!wiz && !ut_isobjown(aswho,ob)) {
say(who,"You don't own ",ut_name(ob),".\n",(char *)0);
continue;
}
if((op = cache_get(ob)) == (Obj *)0) {
say(who,"no object ",ob,"\n",(char *)0);
} else {
(void)oiftowho(op,who,ob);
}
}
return(UERR_NONE);
}