summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapdef.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-05-15 14:37:29 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2014-05-15 14:55:40 -0600
commitca0822add27cfd9c9871abebb43b43a4f3bc93d7 (patch)
treea9591eddd99a0c052e3b9692352ad31952844f4c /crawl-ref/source/mapdef.cc
parent41433f0fcd2501fbaf8c75c8e69c1ad75aa36d8d (diff)
downloadcrawl-ref-ca0822add27cfd9c9871abebb43b43a4f3bc93d7.tar.gz
crawl-ref-ca0822add27cfd9c9871abebb43b43a4f3bc93d7.zip
Make mini_float the default; add a no_exits tag instead.
There have been so many problems with minivaults not having exits that this is an easier solution than the alternative. You're still allowed to explicitly place exits, of course, in which case floating exits go away. There are a couple of other small tweaks to the level documentation here as well.
Diffstat (limited to 'crawl-ref/source/mapdef.cc')
-rw-r--r--crawl-ref/source/mapdef.cc46
1 files changed, 9 insertions, 37 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index 58587537f1..0843a1ec8a 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -2791,7 +2791,7 @@ string map_def::validate_map_placeable()
/**
* Check to see if the vault can connect normally to the rest of the dungeon.
*/
-bool map_def::has_exit(bool &floating) const
+bool map_def::has_exit() const
{
map_def dup = *this;
for (int y = 0, cheight = map.height(); y < cheight; ++y)
@@ -2804,41 +2804,21 @@ bool map_def::has_exit(bool &floating) const
map_feature_at(&dup, coord_def(x, y), -1);
// If we have a stair, assume the vault can be disconnected.
if (feat_is_stair(feat) && !feat_is_escape_hatch(feat))
- {
- floating = false;
return true;
- }
const bool non_floating =
glyph == '@' || glyph == '=' || glyph == '+';
if (non_floating
|| !feat_is_solid(feat) || feat_is_closed_door(feat))
{
if (x == 0 || x == cwidth - 1 || y == 0 || y == cheight - 1)
- {
- if (non_floating)
- {
- floating = false;
- return true;
- }
- floating = true;
- continue;
- }
+ return true;
for (orth_adjacent_iterator ai(coord_def(x, y)); ai; ++ai)
- {
if (!map.in_map(*ai))
- {
- if (non_floating)
- {
- floating = false;
- return true;
- }
- floating = true;
- }
- }
+ return true;
}
}
- return floating;
+ return false;
}
string map_def::validate_map_def(const depth_ranges &default_depths)
@@ -2960,22 +2940,14 @@ string map_def::validate_map_def(const depth_ranges &default_depths)
// Encompass vaults, pure subvaults, and dummy vaults are exempt from
// exit-checking.
- if (orient != MAP_ENCOMPASS && !has_tag("unrand") && !has_tag("dummy"))
+ if (orient != MAP_ENCOMPASS && !has_tag("unrand") && !has_tag("dummy")
+ && !has_tag("no_exits") && map.width() > 0 && map.height() > 0)
{
- bool floating = false;
- if (!has_exit(floating))
- {
- return make_stringf(
- "Map '%s' has no (possible) exits",
- name.c_str());
- }
- // Lab minivaults work differently - they are supposed to guarantee
- // connectivity around the edge.
- if (floating && is_minivault() && !has_tag("mini_float")
- && !depths.is_usable_in(level_id(BRANCH_LABYRINTH)))
+ if (!has_exit())
{
return make_stringf(
- "Minivault '%s' has no explicit exits or mini_float",
+ "Map '%s' has no (possible) exits; use TAGS: no_exits if "
+ "this is intentional",
name.c_str());
}
}