From: nhmall Date: Wed, 12 Jun 2019 03:24:41 +0000 (-0400) Subject: Merge branch 'NetHack-3.6' X-Git-Tag: NetHack-3.7.0_WIP~373 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61fefd9a9eddaa1b7f7252320efee311f1ce263d;p=nethack Merge branch 'NetHack-3.6' --- 61fefd9a9eddaa1b7f7252320efee311f1ce263d diff --cc src/mklev.c index eeb74fa6c,525e0a58e..a0903be9d --- a/src/mklev.c +++ b/src/mklev.c @@@ -731,23 -733,23 +731,23 @@@ makelevel( debugpline0("trying to make a vault..."); w = 1; h = 1; - if (check_room(&vault_x, &w, &vault_y, &h, TRUE)) { + if (check_room(&g.vault_x, &w, &g.vault_y, &h, TRUE)) { fill_vault: - add_room(g.vault_x, g.vault_y, g.vault_x + w, g.vault_y + h, TRUE, VAULT, - FALSE); - add_room(vault_x, vault_y, vault_x + w, vault_y + h, ++ add_room(g.vault_x, g.vault_y, g.vault_x + w, g.vault_y + h, + TRUE, VAULT, FALSE); - level.flags.has_vault = 1; + g.level.flags.has_vault = 1; ++room_threshold; - fill_room(&rooms[nroom - 1], FALSE); - mk_knox_portal(vault_x + w, vault_y + h); - if (!level.flags.noteleport && !rn2(3)) + fill_room(&g.rooms[g.nroom - 1], FALSE); + mk_knox_portal(g.vault_x + w, g.vault_y + h); + if (!g.level.flags.noteleport && !rn2(3)) makevtele(); } else if (rnd_rect() && create_vault()) { - vault_x = rooms[nroom].lx; - vault_y = rooms[nroom].ly; - if (check_room(&vault_x, &w, &vault_y, &h, TRUE)) + g.vault_x = g.rooms[g.nroom].lx; + g.vault_y = g.rooms[g.nroom].ly; + if (check_room(&g.vault_x, &w, &g.vault_y, &h, TRUE)) goto fill_vault; else - rooms[nroom].hx = -1; + g.rooms[g.nroom].hx = -1; } } @@@ -1679,22 -1681,30 +1679,30 @@@ struct mkroom *croom #define y_maze_min 2 /* - * Major level transmutation: add a set of stairs (to the Sanctum) after - * an earthquake that leaves behind a a new topology, centered at g.inv_pos. + * Major level transmutation: add a set of stairs (to the Sanctum) after + * an earthquake that leaves behind a new topology, centered at inv_pos. - * Assumes there are no rooms within the invocation area and that inv_pos + * Assumes there are no rooms within the invocation area and that g.inv_pos * is not too close to the edge of the map. Also assume the hero can see, * which is guaranteed for normal play due to the fact that sight is needed - * to read the Book of the Dead. + * to read the Book of the Dead. [That assumption is not valid; it is + * possible that "the Book reads the hero" rather than vice versa if + * attempted while blind (in order to make blind-from-birth conduct viable).] */ void mkinvokearea() { int dist; - xchar xmin = g.inv_pos.x, xmax = g.inv_pos.x; - xchar ymin = g.inv_pos.y, ymax = g.inv_pos.y; - xchar xmin = inv_pos.x, xmax = inv_pos.x, - ymin = inv_pos.y, ymax = inv_pos.y; ++ xchar xmin = g.inv_pos.x, xmax = g.inv_pos.x, ++ ymin = g.inv_pos.y, ymax = g.inv_pos.y; register xchar i; + /* slightly odd if levitating, but not wrong */ pline_The("floor shakes violently under you!"); + /* + * TODO: + * Suppress this message if player has dug out all the walls + * that would otherwise be affected. + */ pline_The("walls around you begin to bend and crumble!"); display_nhwindow(WIN_MESSAGE, TRUE); @@@ -1752,9 -1762,8 +1760,8 @@@ int dist /* clip at existing map borders if necessary */ if (!within_bounded_area(x, y, x_maze_min + 1, y_maze_min + 1, - x_maze_max - 1, y_maze_max - 1)) { + g.x_maze_max - 1, g.y_maze_max - 1)) { - /* only outermost 2 columns and/or rows may be truncated due to edge - */ + /* outermost 2 columns and/or rows may be truncated due to edge */ if (dist < (7 - 2)) panic("mkinvpos: <%d,%d> (%d) off map edge!", x, y, dist); return;