--- deliantra/server/random_maps/random_map.C 2006/12/31 20:46:17 1.14 +++ deliantra/server/random_maps/random_map.C 2007/01/11 00:41:08 1.18 @@ -1,7 +1,7 @@ - /* CrossFire, A Multiplayer game for X-windows + Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team Copyright (C) 2001 Mark Wedel & Crossfire Development Team Copyright (C) 1992 Frank Tore Johansen @@ -56,7 +56,7 @@ maptile * generate_random_map (const char *OutFileName, random_map_params *RP) { - char **layout, buf[HUGE_BUF]; + char **layout, buf[16384]; maptile *theMap; int i; @@ -116,7 +116,7 @@ /* set region */ theMap->region = RP->region; - coroapi.cede (); + coroapi::cede (); /* create walls unless the wallstyle is "none" */ if (strcmp (RP->wallstyle, "none")) { @@ -128,38 +128,38 @@ } - coroapi.cede (); + coroapi::cede (); /* create exits unless the exitstyle is "none" */ if (strcmp (RP->exitstyle, "none")) place_exits (theMap, layout, RP->exitstyle, RP->orientation, RP); - coroapi.cede (); + coroapi::cede (); place_specials_in_map (theMap, layout, RP); - coroapi.cede (); + coroapi::cede (); /* create monsters unless the monsterstyle is "none" */ if (strcmp (RP->monsterstyle, "none")) place_monsters (theMap, RP->monsterstyle, RP->difficulty, RP); - coroapi.cede (); + coroapi::cede (); /* treasures needs to have a proper difficulty set for the map. */ theMap->difficulty = theMap->estimate_difficulty (); - coroapi.cede (); + coroapi::cede (); /* create treasure unless the treasurestyle is "none" */ if (strcmp (RP->treasurestyle, "none")) place_treasure (theMap, layout, RP->treasurestyle, RP->treasureoptions, RP); - coroapi.cede (); + coroapi::cede (); /* create decor unless the decorstyle is "none" */ if (strcmp (RP->decorstyle, "none")) put_decor (theMap, layout, RP->decorstyle, RP->decoroptions, RP); - coroapi.cede (); + coroapi::cede (); /* generate treasures, etc. */ theMap->fix_auto_apply (); - coroapi.cede (); + coroapi::cede (); unblock_exits (theMap, layout, RP); /* free the layout */ @@ -633,7 +633,7 @@ void write_map_parameters_to_string (char *buf, random_map_params *RP) { - char small_buf[2048]; + char small_buf[16384]; sprintf (buf, "xsize %d\nysize %d\n", RP->Xsize, RP->Ysize); @@ -778,13 +778,6 @@ strcat (buf, small_buf); } - if (RP->random_seed) - { - /* Add one so that the next map is a bit different */ - sprintf (small_buf, "random_seed %d\n", RP->random_seed + 1); - strcat (buf, small_buf); - } - if (RP->treasureoptions) { sprintf (small_buf, "treasureoptions %d\n", RP->treasureoptions); @@ -796,6 +789,12 @@ sprintf (small_buf, "random_seed %d\n", RP->random_seed); strcat (buf, small_buf); } + + if (RP->custom) + { + sprintf (small_buf, "custom %s\n", RP->custom); + strcat (buf, small_buf); + } } void @@ -825,7 +824,7 @@ int orientation_n, int origin_x_n, int origin_y_n, int random_seed_n, int treasureoptions_n, float difficulty_increase) { - char small_buf[2048]; + char small_buf[16384]; sprintf (buf, "xsize %d\nysize %d\n", xsize_n, ysize_n);