--- deliantra/server/random_maps/random_map.C 2006/09/10 16:06:37 1.3 +++ deliantra/server/random_maps/random_map.C 2006/12/13 21:27:09 1.8 @@ -1,9 +1,3 @@ - -/* - * static char *rcsid_random_map_c = - * "$Id: random_map.C,v 1.3 2006/09/10 16:06:37 root Exp $"; - */ - /* CrossFire, A Multiplayer game for X-windows @@ -24,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - The authors can be reached via e-mail at crossfire-devel@real-time.com + The authors can be reached via e-mail at */ #include @@ -57,12 +51,14 @@ } printf ("\n"); } -EXTERN FILE *logfile; -mapstruct * + +extern FILE *logfile; + +maptile * generate_random_map (const char *OutFileName, RMParms * RP) { char **layout, buf[HUGE_BUF]; - mapstruct *theMap; + maptile *theMap; int i; /* pick a random seed, or use the one from the input file */ @@ -76,18 +72,19 @@ if (RP->difficulty == 0) { RP->difficulty = RP->dungeon_level; /* use this instead of a map difficulty */ + if (RP->difficulty_increase > 0.001) - { - RP->difficulty = (int) ((float) RP->dungeon_level * RP->difficulty_increase); - if (RP->difficulty < 1) - RP->difficulty = 1; - } + RP->difficulty = (int) ((float) RP->dungeon_level * RP->difficulty_increase); + + if (RP->difficulty < 1) + RP->difficulty = 1; } else RP->difficulty_given = 1; if (RP->Xsize < MIN_RANDOM_MAP_SIZE) RP->Xsize = MIN_RANDOM_MAP_SIZE + RANDOM () % 25 + 5; + if (RP->Ysize < MIN_RANDOM_MAP_SIZE) RP->Ysize = MIN_RANDOM_MAP_SIZE + RANDOM () % 25 + 5; @@ -170,7 +167,6 @@ return theMap; } - /* function selects the layout function and gives it whatever arguments it needs. */ char ** @@ -998,12 +994,12 @@ { object *walk, *tmp; - copy_object (src_ob, dest_ob); + src_ob->copy_to (dest_ob); for (walk = src_ob->inv; walk != NULL; walk = walk->below) { - tmp = get_object (); - copy_object (walk, tmp); + tmp = object::create (); + walk->copy_to (tmp); insert_ob_in_ob (tmp, dest_ob); } }