From 0ec7cf7056fb1e230696a46f0f776f72bd49a6fe Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 9 Jul 2007 17:41:11 +0000 Subject: Superior minivault handling. Minivaults without floor padding are finally supported (see mines4_lemuel for an example). Set default depth to D:a-b in all .des files. Random vaults that want to live in a non-main-dungeon branch must explicitly specify this in a DEPTH: line. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1823 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/dungeon.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/dungeon.cc') diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index cd0ae021a5..2106a55c36 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -161,6 +161,10 @@ static int box_room_doors( int bx1, int bx2, int by1, int by2, int new_doors); static void city_level(int level_number); static void diamond_rooms(int level_number); +static void pick_float_exits(vault_placement &place, + std::vector &targets); +static void connect_vault(const vault_placement &vp); + // ITEM & SHOP FUNCTIONS static void place_shops(int level_number); static object_class_type item_in_shop(unsigned char shop_type); @@ -2687,9 +2691,10 @@ static bool build_minivaults(int level_number, int force_vault, apply_place_masks(place); // these two are throwaways: - std::vector dummy; int num_runes = 0; + std::vector &target_connections = place.exits; + // paint the minivault onto the grid for (int vx = v1x; vx < v1x + place.width; vx++) { @@ -2701,11 +2706,17 @@ static bool build_minivaults(int level_number, int force_vault, altar_count = vault_grid( place, level_number, vx, vy, altar_count, acq_item_class, - feat, dummy, + feat, target_connections, num_runes ); } } + if (target_connections.empty() && place.map.has_tag("mini_float")) + pick_float_exits(place, target_connections); + + if (!target_connections.empty()) + connect_vault(place); + return (true); } // end build_minivaults() -- cgit v1.2.3-54-g00ecf