Difference for random_maps/random_map.c from version 1.28 to 1.29


version 1.28 version 1.29
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_random_map_c =   * static char *rcsid_random_map_c =
  *   "$Id: random_map.c,v 1.28 2001/10/07 06:45:40 mwedel Exp $";   *   "$Id: random_map.c,v 1.29 2003/02/16 09:03:31 mwedel Exp $";
  */   */
   
 /*  /*
Line 48
 
Line 48
 }  }
 EXTERN FILE *logfile;  EXTERN FILE *logfile;
 mapstruct *generate_random_map(char *OutFileName, RMParms *RP) {  mapstruct *generate_random_map(char *OutFileName, RMParms *RP) {
   char **layout;      char **layout, buf[HUGE_BUF];
   mapstruct *theMap;    mapstruct *theMap;
       int i;
   
   /* pick a random seed, or use the one from the input file */    /* pick a random seed, or use the one from the input file */
   if(RP->random_seed == 0)    SRANDOM(time(0));      if(RP->random_seed == 0)
   else SRANDOM(RP->random_seed);   RP->random_seed=time(0);
   
       SRANDOM(RP->random_seed);
   
       write_map_parameters_to_string(buf, RP);
   
   if(RP->difficulty==0)    if(RP->difficulty==0)
     RP->difficulty = RP->dungeon_level; /* use this instead of a map difficulty  */      RP->difficulty = RP->dungeon_level; /* use this instead of a map difficulty  */
Line 77
 
Line 82
 #ifdef RMAP_DEBUG  #ifdef RMAP_DEBUG
   dump_layout(layout,RP);    dump_layout(layout,RP);
 #endif  #endif
   
   /* allocate the map and set the floor */    /* allocate the map and set the floor */
   theMap = make_map_floor(layout,RP->floorstyle,RP);     theMap = make_map_floor(layout,RP->floorstyle,RP);
   
Line 93
 
Line 99
   
   place_monsters(theMap,RP->monsterstyle,RP->difficulty,RP);    place_monsters(theMap,RP->monsterstyle,RP->difficulty,RP);
   
   /* treasures needs to have a proper difficulty set for      /* treasures needs to have a proper difficulty set for the map. */
      the map. */  
   theMap->difficulty=calculate_difficulty(theMap);    theMap->difficulty=calculate_difficulty(theMap);
   
   place_treasure(theMap,layout,RP->treasurestyle,RP->treasureoptions,RP);    place_treasure(theMap,layout,RP->treasurestyle,RP->treasureoptions,RP);
Line 106
 
Line 111
     fix_auto_apply(theMap);      fix_auto_apply(theMap);
   
   unblock_exits(theMap,layout,RP);    unblock_exits(theMap,layout,RP);
   /*  fclose(OutFile); */  
   /*new_save_map(theMap,1);*/  
   
   /*free the layout */    /*free the layout */
   { int i;  
     for(i=0;i<RP->Xsize;i++)      for(i=0;i<RP->Xsize;i++)
       free(layout[i]);        free(layout[i]);
     free(layout);      free(layout);
   }  
       theMap->msg = add_string(buf);
      
   return theMap;    return theMap;
 }  }
Line 628
 
Line 631
     strcat(buf,small_buf);      strcat(buf,small_buf);
   }    }
   if(RP->random_seed) {    if(RP->random_seed) {
     sprintf(small_buf,"random_seed %d\n",RP->random_seed + 1);      sprintf(small_buf,"random_seed %d\n",RP->random_seed);
     strcat(buf,small_buf);      strcat(buf,small_buf);
   }    }
   
Line 778
 
Line 781
     strcat(buf,small_buf);      strcat(buf,small_buf);
   }    }
   if(random_seed_n) {    if(random_seed_n) {
     sprintf(small_buf,"random_seed %d\n",random_seed_n + 1);      sprintf(small_buf,"random_seed %d\n",random_seed_n);
     strcat(buf,small_buf);      strcat(buf,small_buf);
   }    }
   


Legend:
line(s) removed in v.1.28 
line(s) changed
 line(s) added in v.1.29

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:55