diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-04-02 21:53:11 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-04-02 22:08:27 +0200 |
commit | 6eb6d9b8aa702f333d480158265cc0c3a469a0c9 (patch) | |
tree | a8d164a36e347a73413997600d2d3e866de5a3b8 /src/q_rand.c | |
parent | 9bbfe24fccd16a17c89f9222ded38aa5a220c4f6 (diff) |
Refactor: Clean up process_dungeon_file()
Diffstat (limited to 'src/q_rand.c')
-rw-r--r-- | src/q_rand.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/q_rand.c b/src/q_rand.c index 50617bb8..5a3b3ab2 100644 --- a/src/q_rand.c +++ b/src/q_rand.c @@ -316,12 +316,7 @@ bool_ quest_random_gen_hook(char *fmt) bx0 = get_next_arg(fmt); /* Pick a room size */ - xsize = 0; - ysize = 0; - init_flags = INIT_GET_SIZE; - process_dungeon_file_full = TRUE; - process_dungeon_file(NULL, format("qrand%d.map", random_quests[dun_level].type), &ysize, &xsize, cur_hgt, cur_wid, TRUE); - process_dungeon_file_full = FALSE; + get_map_size(format("qrand%d.map", random_quests[dun_level].type), &ysize, &xsize); /* Try to allocate space for room. If fails, exit */ if (!room_alloc(xsize + 2, ysize + 2, FALSE, by0, bx0, &xval, &yval)) return FALSE; @@ -353,9 +348,7 @@ bool_ quest_random_gen_hook(char *fmt) xstart = x1; ystart = y1; init_flags = INIT_CREATE_DUNGEON; - process_dungeon_file_full = TRUE; - process_dungeon_file(NULL, format("qrand%d.map", random_quests[dun_level].type), &ystart, &xstart, cur_hgt, cur_wid, TRUE); - process_dungeon_file_full = FALSE; + process_dungeon_file(format("qrand%d.map", random_quests[dun_level].type), &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE); for (x = x1; x < xstart; x++) for (y = y1; y < ystart; y++) |