From 110557ace89baee4288a274365f73516e85a5c4d Mon Sep 17 00:00:00 2001 From: nothere Date: Thu, 31 Jul 2003 12:23:47 +0000 Subject: [PATCH] =?utf8?q?bound=5Fwalls=5Fperm=E7=84=A1=E5=8A=B9=E6=99=82?= =?utf8?q?=E3=81=AB,=20=E9=9A=A0=E3=81=97=E3=81=A7=E3=81=AF=E3=81=AA?= =?utf8?q?=E3=81=84=E8=B2=A1=E5=AE=9D=E3=81=AE=E9=89=B1=E8=84=88=E3=81=8C?= =?utf8?q?=E3=83=80=E3=83=B3=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=AE=E5=A4=96?= =?utf8?q?=E5=A3=81=E3=81=AB=20=E5=87=BA=E3=81=AA=E3=81=84=E3=82=88?= =?utf8?q?=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/generate.c | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/src/generate.c b/src/generate.c index 7b9d444c4..daa2e1a76 100644 --- a/src/generate.c +++ b/src/generate.c @@ -466,6 +466,31 @@ void place_quest_monsters(void) /* + * Set boundary mimic and add "solid" perma-wall + */ +static void set_bound_perm_wall(cave_type *c_ptr) +{ + if (bound_walls_perm) + { + /* Clear boundary mimic */ + c_ptr->mimic = 0; + } + else + { + /* Hack -- Decline boundary walls with known treasure */ + if ((c_ptr->feat == FEAT_MAGMA_K) || (c_ptr->feat == FEAT_QUARTZ_K)) + c_ptr->feat -= (FEAT_MAGMA_K - FEAT_MAGMA); + + /* Set boundary mimic */ + c_ptr->mimic = f_info[c_ptr->feat].mimic; + } + + /* Add "solid" perma-wall */ + c_ptr->feat = FEAT_PERM_SOLID; +} + + +/* * Generate a new dungeon level * * Note that "dun_body" adds about 4000 bytes of memory to the stack. @@ -991,33 +1016,15 @@ static bool cave_gen(void) /* Special boundary walls -- Top and bottom */ for (x = 0; x < cur_wid; x++) { - cave_type *c_ptr = &cave[0][x]; - - /* Set boundary mimic and add "solid" perma-wall */ - c_ptr->mimic = bound_walls_perm ? 0 : f_info[c_ptr->feat].mimic; - c_ptr->feat = FEAT_PERM_SOLID; - - c_ptr = &cave[cur_hgt - 1][x]; - - /* Set boundary mimic and add "solid" perma-wall */ - c_ptr->mimic = bound_walls_perm ? 0 : f_info[c_ptr->feat].mimic; - c_ptr->feat = FEAT_PERM_SOLID; + set_bound_perm_wall(&cave[0][x]); + set_bound_perm_wall(&cave[cur_hgt - 1][x]); } /* Special boundary walls -- Left and right */ for (y = 1; y < (cur_hgt - 1); y++) { - cave_type *c_ptr = &cave[y][0]; - - /* Set boundary mimic and add "solid" perma-wall */ - c_ptr->mimic = bound_walls_perm ? 0 : f_info[c_ptr->feat].mimic; - c_ptr->feat = FEAT_PERM_SOLID; - - c_ptr = &cave[y][cur_wid - 1]; - - /* Set boundary mimic and add "solid" perma-wall */ - c_ptr->mimic = bound_walls_perm ? 0 : f_info[c_ptr->feat].mimic; - c_ptr->feat = FEAT_PERM_SOLID; + set_bound_perm_wall(&cave[y][0]); + set_bound_perm_wall(&cave[y][cur_wid - 1]); } /* Determine the character location */ -- 2.11.0