summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-08 10:25:51 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-08 10:25:51 +0000
commitecb40974abb1b8db7db7baf7dba0be77895bb500 (patch)
treeb5b5169ec1a8feee9a217ca6492f2fbb09af6b6e /crawl-ref
parentb0e3bb6ae065f4c5c8684dc006d8f974287658fe (diff)
downloadcrawl-ref-ecb40974abb1b8db7db7baf7dba0be77895bb500.tar.gz
crawl-ref-ecb40974abb1b8db7db7baf7dba0be77895bb500.zip
Vault collision checks were still assuming rectangles, fixed.
More minor vault tweaks. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1793 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/dat/float.des2
-rw-r--r--crawl-ref/source/dat/lab.des15
-rw-r--r--crawl-ref/source/dungeon.cc8
-rw-r--r--crawl-ref/source/maps.cc36
4 files changed, 30 insertions, 31 deletions
diff --git a/crawl-ref/source/dat/float.des b/crawl-ref/source/dat/float.des
index 5114817cc0..604b90bfe3 100644
--- a/crawl-ref/source/dat/float.des
+++ b/crawl-ref/source/dat/float.des
@@ -181,7 +181,7 @@ ENDMAP
# but since they are normal speed with no range attacks, they can be escaped
#
NAME: slime_lemuel
-DEPTH: 11-16, Lair
+DEPTH: 9-16, Lair
ORIENT: float
MONS: w:20 ooze/jelly/fungus, slime creature/giant amoeba/oklob plant
MAP
diff --git a/crawl-ref/source/dat/lab.des b/crawl-ref/source/dat/lab.des
index 2579eadc97..f716deb1cf 100644
--- a/crawl-ref/source/dat/lab.des
+++ b/crawl-ref/source/dat/lab.des
@@ -297,6 +297,21 @@ MAP
ENDMAP
############################################################################
+# The other minotaur's lava lair
+NAME: labyrinth_lava_lair
+TAGS: lab
+MONS: minotaur zombie
+MAP
+.......
+.lllll.
+.l***l.
+.l*1*l.
+.l***l.
+.lllll.
+.......
+ENDMAP
+
+############################################################################
# Baited teleport trap - this is evil!
NAME: labyrinth_baited_teleportation_trap
TAGS: lab
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index cabab1adcb..6ef81ba2d4 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -2549,11 +2549,6 @@ static void beehive(spec_room &sr)
static bool safe_minivault_place(int v1x, int v1y,
const vault_placement &place)
{
- dgn_region reg(v1x, v1y, place.width, place.height);
-
- if (reg.overlaps(vault_zones, dgn_map_mask))
- return (false);
-
const bool water_ok = place.map.has_tag("water_ok");
const std::vector<std::string> &lines = place.map.map.get_lines();
for (int vx = v1x; vx < v1x + place.width; vx++)
@@ -2562,6 +2557,9 @@ static bool safe_minivault_place(int v1x, int v1y,
{
if (lines[vy - v1y][vx - v1x] == ' ')
continue;
+
+ if (dgn_map_mask[vx][vy])
+ return (false);
if ((grd[vx][vy] != DNGN_FLOOR
&& grd[vx][vy] != DNGN_ROCK_WALL
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc
index 15d6bf5913..1d609e3929 100644
--- a/crawl-ref/source/maps.cc
+++ b/crawl-ref/source/maps.cc
@@ -147,9 +147,15 @@ static bool resolve_map(map_def &map, const map_def &original)
return (true);
}
-static bool is_grid_clobbered(const map_def &map,
- int sx, int sy, int width, int height)
+// Determines if the region specified by (x, y, x + width - 1, y + height - 1)
+// is a bad place to build a vault.
+static bool bad_map_place(const map_def &map,
+ int sx, int sy, int width, int height,
+ std::vector<vault_placement> *avoid)
{
+ if (!avoid)
+ return (false);
+
const std::vector<std::string> &lines = map.map.get_lines();
for (int y = sy; y < sy + height; ++y)
{
@@ -157,6 +163,9 @@ static bool is_grid_clobbered(const map_def &map,
{
if (lines[y - sy][x - sx] == ' ')
continue;
+
+ if (dgn_map_mask[x][y])
+ return (true);
const dungeon_feature_type grid = grd[x][y];
@@ -176,29 +185,6 @@ static bool is_grid_clobbered(const map_def &map,
return (false);
}
-// Determines if the region specified by (x, y, x + width - 1, y + height - 1)
-// is a bad place to build a vault.
-static bool bad_map_place(const map_def &map,
- int x, int y, int width, int height,
- std::vector<vault_placement> *avoid)
-{
- if (!avoid)
- return (false);
-
- const dgn_region thisvault(x, y, width, height);
-
- for (int i = 0, size = avoid->size(); i < size; ++i)
- {
- const vault_placement &vp = (*avoid)[i];
- const dgn_region vault(vp.x, vp.y, vp.width, vp.height);
-
- if (thisvault.overlaps(vault) && thisvault.overlaps(dgn_map_mask))
- return (true);
- }
-
- return (is_grid_clobbered(map, x, y, width, height));
-}
-
static bool apply_vault_grid(map_def &def, map_type map,
vault_placement &place,
std::vector<vault_placement> *avoid)