summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/viewmap.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-07-15 01:46:20 +0200
committerAdam Borowski <kilobyte@angband.pl>2013-07-15 01:55:52 +0200
commit6e24c03402f36e77e69478b127a52ff55c6d9b87 (patch)
tree68bfa899169de4d793485dae32540e57384ff292 /crawl-ref/source/viewmap.cc
parent2f64357b89e48286cf6655b16bc76dc1d97e889d (diff)
downloadcrawl-ref-6e24c03402f36e77e69478b127a52ff55c6d9b87.tar.gz
crawl-ref-6e24c03402f36e77e69478b127a52ff55c6d9b87.zip
Show all forgotten map data as magic-mapped.
It is enough to both force re-autoexplore, and to show the player old vs new areas. I see no reason to keep a method of forgetting the map completely.
Diffstat (limited to 'crawl-ref/source/viewmap.cc')
-rw-r--r--crawl-ref/source/viewmap.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/crawl-ref/source/viewmap.cc b/crawl-ref/source/viewmap.cc
index eaf3cfc65a..ef8fabde52 100644
--- a/crawl-ref/source/viewmap.cc
+++ b/crawl-ref/source/viewmap.cc
@@ -704,8 +704,7 @@ static void _unforget_map()
MapKnowledge &old(*env.map_forgotten.get());
for (rectangle_iterator ri(0); ri; ++ri)
- if (!env.map_knowledge(*ri).known()
- && (!env.map_knowledge(*ri).mapped() || old(*ri).known()))
+ if (!env.map_knowledge(*ri).seen() && old(*ri).seen())
{
// Don't overwrite known squares, nor magic-mapped with
// magic-mapped data -- what was forgotten is less up to date.
@@ -713,6 +712,17 @@ static void _unforget_map()
}
}
+static void _forget_map()
+{
+ for (rectangle_iterator ri(0); ri; ++ri)
+ {
+ if (env.map_knowledge(*ri).flags & MAP_VISIBLE_FLAG)
+ continue;
+ env.map_knowledge(*ri).flags &= ~MAP_SEEN_FLAG;
+ env.map_knowledge(*ri).flags |= MAP_MAGIC_MAPPED_FLAG;
+ }
+}
+
// show_map() now centers the known map along x or y. This prevents
// the player from getting "artificial" location clues by using the
// map to see how close to the end they are. They'll need to explore
@@ -975,7 +985,7 @@ bool show_map(level_pos &lpos,
if (env.map_forgotten.get())
_unforget_map();
MapKnowledge *old = new MapKnowledge(env.map_knowledge);
- forget_map();
+ _forget_map();
env.map_forgotten.reset(old);
mpr("Level map cleared.");
}