aload.c

gurba-0.40/lib/cmds/wiz/aload.c · 778 B

From the archive gurba.tgz

Download the archive   « Back to the archive contents

void main( void ) {
   string file, argument, rest;
   object ob;
   string str;
   
   str = this_player()->query_autoload_string();
   while(str && str != "*^!") {
      if (sscanf(str, "%s:%s^!%s", file, argument, rest) != 3) {
         write("Autoload string corrupt.\n");
         return;
      }
      str = rest;
      if( file_exists( file ) ) {
         write("file = "+file+"\n");
         write("argument = "+argument+"\n");
         write("rest = "+rest+"\n\n");
         ob = clone_object( file );
         if( ob ) {
            ob->move( this_player()->query_environment() );
            ob->setup();
            if( argument ) {
               ob->initialize_autoload( argument );
            }
            ob->move( this_player() );
         } 
      }
   }
}

Site Stats

Snippets: 1791
Codebases: 571