summaryrefslogtreecommitdiff
path: root/src/generate.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2011-04-13 19:28:00 +0200
committerBardur Arantsson <bardur@scientician.net>2012-03-29 20:13:07 +0200
commit6b7047f796370199f357ed0b3bae6afa350c6ae9 (patch)
treebc7af9fabf0bc8de488753afb610a748c255a200 /src/generate.c
parent078322fd938187b6c88505f23eb823f930372ba9 (diff)
Refactor: Factor out a little common code in generate.c.
Diffstat (limited to 'src/generate.c')
-rw-r--r--src/generate.c43
1 files changed, 15 insertions, 28 deletions
diff --git a/src/generate.c b/src/generate.c
index b3036e1d..69588dc8 100644
--- a/src/generate.c
+++ b/src/generate.c
@@ -8630,47 +8630,34 @@ void generate_cave(void)
/* Build the town */
else if (!dun_level)
{
- /* Big wilderness mode */
- if (!p_ptr->wild_mode)
- {
- /* Big town */
- cur_hgt = MAX_HGT;
- cur_wid = MAX_WID;
+ /* Big town */
+ cur_hgt = MAX_HGT;
+ cur_wid = MAX_WID;
- /* Determine number of panels */
- max_panel_rows = (cur_hgt / SCREEN_HGT) * 2 - 2;
- max_panel_cols = (cur_wid / SCREEN_WID) * 2 - 2;
+ /* Determine number of panels */
+ max_panel_rows = (cur_hgt / SCREEN_HGT) * 2 - 2;
+ max_panel_cols = (cur_wid / SCREEN_WID) * 2 - 2;
- /* Assume illegal panel */
- panel_row_min = max_panel_rows * (SCREEN_HGT / 2);
- panel_col_min = max_panel_cols * (SCREEN_WID / 2);
+ /* Assume illegal panel */
+ panel_row_min = max_panel_rows * (SCREEN_HGT / 2);
+ panel_col_min = max_panel_cols * (SCREEN_WID / 2);
+ /* Big wilderness mode */
+ if (!p_ptr->wild_mode)
+ {
/* Make the wilderness */
wilderness_gen(0);
-
- okay = TRUE;
}
/* Small wilderness mode */
else
{
- /* Big screen */
- cur_hgt = MAX_HGT;
- cur_wid = MAX_WID;
-
- /* Determine number of panels */
- max_panel_rows = (cur_hgt / SCREEN_HGT) * 2 - 2;
- max_panel_cols = (cur_wid / SCREEN_WID) * 2 - 2;
-
- /* Assume illegal panel */
- panel_row_min = max_panel_rows * (SCREEN_HGT / 2);
- panel_col_min = max_panel_cols * (SCREEN_WID / 2);
-
/* Make the wilderness */
wilderness_gen_small();
-
- okay = TRUE;
}
+
+
+ okay = TRUE;
}
/* Build a dungeon level */