summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-09 23:32:48 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-09 23:32:48 +0000
commit3d61cb6bfb25cf45dbc654086491ed0f037e8a6b (patch)
tree1b12df506e1f92a9b82a02b2e5f80012b8b36c25 /crawl-ref/source
parentc71ba7d0952df27c8041532f895735c2f2b17460 (diff)
downloadcrawl-ref-3d61cb6bfb25cf45dbc654086491ed0f037e8a6b.tar.gz
crawl-ref-3d61cb6bfb25cf45dbc654086491ed0f037e8a6b.zip
Better fix for [2478607]: colours leaking information about trap status.
There is still a bug in that 'x'ing over a former trap will describe the feature as 'floor' rather than 'trap'. This is because _describe_feature() looks at the actual grid, not the envmap. However, there is currently no perfect way to prevent this: map_cell only stores an appearance, not the actual feature layer. So if a monster was on a trap when you last saw it, and then the trap gets disarmed, there is no way to know that there was once a trap there. The correct fix is to have map_cell remember the object, feature and monster layers separately, but since this will break savefiles and require some work, I'm not fixing it yet. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9020 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/view.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 765509a497..dd380b4107 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -689,7 +689,13 @@ screen_buffer_t colour_code_map( const coord_def& p, bool item_colour,
return (LIGHTGREEN);
#endif
- const dungeon_feature_type grid_value = grd(p);
+ dungeon_feature_type grid_value = grd(p);
+ if (!see_grid(p))
+ {
+ const int remembered = get_envmap_obj(p);
+ if (remembered < NUM_REAL_FEATURES)
+ grid_value = static_cast<dungeon_feature_type>(remembered);
+ }
unsigned tc = travel_colour ? _get_travel_colour(p) : DARKGREY;