summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-07-02 17:02:51 -0400
committerNeil Moore <neil@s-z.org>2014-07-02 17:05:06 -0400
commite872541d54f7ef1686daddd3beb1479ad5cb423e (patch)
treea81f15f78f62db29136ea6bf8842f8be9d9cab07
parented3dc989f9b3c80e3cca87b4f1296106cebe2af0 (diff)
downloadcrawl-ref-e872541d54f7ef1686daddd3beb1479ad5cb423e.tar.gz
crawl-ref-e872541d54f7ef1686daddd3beb1479ad5cb423e.zip
Don't overwrite primary vault tiles with layout tiles (#8108, #6150)
The remaining problem behind this longstanding bug was that the layout overwrote the colour, height, tiles, etc. of all squares---even ones that were already placed by the primary vault.
-rw-r--r--crawl-ref/source/dungeon.cc2
-rw-r--r--crawl-ref/source/mapdef.cc8
-rw-r--r--crawl-ref/source/mapdef.h4
3 files changed, 8 insertions, 6 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 5690fa7357..a17c1ee1b8 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -6851,7 +6851,7 @@ void vault_placement::apply_grid()
_vault_grid_mons(*this, feat, *ri, mapsp);
}
- map.map.apply_overlays(pos);
+ map.map.apply_overlays(pos, map.is_overwritable_layout());
}
}
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index 1fe5a41463..24982bf68e 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -579,7 +579,7 @@ void map_lines::apply_markers(const coord_def &c)
markers.clear();
}
-void map_lines::apply_grid_overlay(const coord_def &c)
+void map_lines::apply_grid_overlay(const coord_def &c, bool is_layout)
{
if (!overlay.get())
return;
@@ -588,6 +588,8 @@ void map_lines::apply_grid_overlay(const coord_def &c)
for (int x = width() - 1; x >= 0; --x)
{
coord_def gc(c.x + x, c.y + y);
+ if (is_layout && map_masked(gc, MMT_VAULT))
+ continue;
const int colour = (*overlay)(x, y).colour;
if (colour)
@@ -671,10 +673,10 @@ void map_lines::apply_grid_overlay(const coord_def &c)
}
}
-void map_lines::apply_overlays(const coord_def &c)
+void map_lines::apply_overlays(const coord_def &c, bool is_layout)
{
apply_markers(c);
- apply_grid_overlay(c);
+ apply_grid_overlay(c, is_layout);
}
const vector<string> &map_lines::get_lines() const
diff --git a/crawl-ref/source/mapdef.h b/crawl-ref/source/mapdef.h
index 38b7e869bf..c48e59671b 100644
--- a/crawl-ref/source/mapdef.h
+++ b/crawl-ref/source/mapdef.h
@@ -392,8 +392,8 @@ public:
string add_lua_marker(const string &key, const lua_datum &fn);
void apply_markers(const coord_def &pos);
- void apply_grid_overlay(const coord_def &pos);
- void apply_overlays(const coord_def &pos);
+ void apply_grid_overlay(const coord_def &pos, bool is_layout);
+ void apply_overlays(const coord_def &pos, bool is_layout);
const vector<string> &get_lines() const;
vector<string> &get_lines();