--- deliantra/server/random_maps/exit.C 2010/07/02 15:03:57 1.45 +++ deliantra/server/random_maps/exit.C 2010/07/03 01:12:44 1.46 @@ -128,8 +128,8 @@ int downx = -1, downy = -1; int final_map_exit = 1; - if (RP->exit_on_final_map) - if (strstr (RP->exit_on_final_map, "no")) + if (const char *eofm = RP->get_str ("exit_on_final_map", 0)) + if (strstr (eofm, "no")) final_map_exit = 0; if (!orientation) @@ -163,8 +163,10 @@ ? style_map_up->pick_random_object (rmg_rndm)->clone () : archetype::get (shstr_exit); + const char *final_map = RP->get_str ("final_map", 0); + /* we need a down exit only if we're recursing. */ - if (RP->dungeon_level < RP->dungeon_depth || *RP->final_map) + if (RP->dungeon_level < RP->dungeon_depth || final_map) the_exit_down = style_map_down ? style_map_down->pick_random_object (rmg_rndm)->clone () : archetype::get (shstr_exit); @@ -172,9 +174,9 @@ the_exit_down = 0; /* set up the up exit */ - the_exit_up->stats.hp = RP->origin_x; - the_exit_up->stats.sp = RP->origin_y; - the_exit_up->slaying = RP->origin_map; + the_exit_up->stats.hp = RP->get_iv ("origin_x", -1); + the_exit_up->stats.sp = RP->get_iv ("origin_y", -1); + the_exit_up->slaying = RP->get_str ("origin_map", 0); /* figure out where to put the entrance */ /* begin a logical block */ @@ -281,24 +283,24 @@ int i = rmg_find_free_spot (the_exit_down, map, downx, downy, 1, SIZEOFFREE1 + 1); the_exit_down->x = downx + freearr_x[i]; the_exit_down->y = downy + freearr_y[i]; - RP->origin_x = the_exit_down->x; - RP->origin_y = the_exit_down->y; + RP->set ("origin_x", (IV)the_exit_down->x); + RP->set ("origin_y", (IV)the_exit_down->y); the_exit_down->msg = RP->as_shstr (); /* the identifier for making a random map. */ - if (RP->dungeon_level >= RP->dungeon_depth && *RP->final_map) + if (RP->dungeon_level >= RP->dungeon_depth && final_map) { maptile *new_map; object *the_exit_back = the_exit_up->arch->instance (); /* load it */ - if (!(new_map = maptile::find_sync (RP->final_map))) + if (!(new_map = maptile::find_sync (final_map))) return; new_map->load_sync (); - the_exit_down->slaying = RP->final_map; + the_exit_down->slaying = final_map; for (object *tmp = new_map->at (new_map->enter_x, new_map->enter_y).bot; tmp; tmp = tmp->above) /* Remove exit back to previous random map. There should only be one @@ -312,7 +314,7 @@ break; } - if (final_map_exit == 1) + if (final_map_exit) { /* setup the exit back */ the_exit_back->slaying = map->path;