summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapmark.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-29 17:10:16 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-29 17:10:16 +0000
commit199d107c9f40413126a31fcc843f5c54608bc73c (patch)
tree444c9eb8c251d8d365e542e6cbbf3a8fd387138d /crawl-ref/source/mapmark.cc
parent1fef821214bcc2300fd2346c05cffb1b800104c5 (diff)
downloadcrawl-ref-199d107c9f40413126a31fcc843f5c54608bc73c.tar.gz
crawl-ref-199d107c9f40413126a31fcc843f5c54608bc73c.zip
&L can place encompass levels, and is more aggressive about overwriting
existing dungeon features. Dungeon features of importance - such as stairs, shops, and altars - and map markers are shifted out of the way, to the nearest free floor square. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1947 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mapmark.cc')
-rw-r--r--crawl-ref/source/mapmark.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc
index 2f2dc84a6b..191466f9e2 100644
--- a/crawl-ref/source/mapmark.cc
+++ b/crawl-ref/source/mapmark.cc
@@ -421,6 +421,27 @@ map_marker *env_find_marker(const coord_def &c, map_marker_type type)
return (NULL);
}
+void env_move_markers(const coord_def &from, const coord_def &to)
+{
+ std::pair<dgn_marker_map::iterator, dgn_marker_map::iterator>
+ els = env.markers.equal_range(from);
+
+ std::list<map_marker*> markers;
+ for (dgn_marker_map::iterator i = els.first; i != els.second; )
+ {
+ dgn_marker_map::iterator curr = i++;
+ markers.push_back(curr->second);
+ env.markers.erase(curr);
+ }
+
+ for (std::list<map_marker*>::iterator i = markers.begin();
+ i != markers.end(); ++i)
+ {
+ (*i)->pos = to;
+ env_add_marker(*i);
+ }
+}
+
std::vector<map_marker*> env_get_markers(const coord_def &c)
{
std::pair<dgn_marker_map::const_iterator, dgn_marker_map::const_iterator>