list.c

gurba-0.40/lib/cmds/player/list.c · 514 B

From the archive gurba.tgz

Download the archive   « Back to the archive contents

void main( string str ) {
  object vendor;
  object *objs;
  int i;

  if( this_environment()->is_storage() == 1 ) {
    write( this_environment()->query_stored_list() );
  } else {

    objs = this_environment()->query_inventory();

    for( i = 0; i < sizeof( objs ); i ++ ) {
      if( objs[i]->is_vendor() == 1 )
	vendor = objs[i];
    }
    if( vendor == 0 ) {
      this_player()->write( "Perhaps you should try to do this somewhere else?" );
      return;
    }

    vendor->do_list( this_player() );
  }
}

Site Stats

Snippets: 1791
Codebases: 571