summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-08 16:58:12 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-08 16:58:12 +0000
commite1fd90e1326d50c530aebe1edbbbc7deae291194 (patch)
tree471ec7bc284fed16292049d1d0190e5560f0f6d2
parent657087df6ba4240fda3e82ecc05428d311e0fb1e (diff)
downloadcrawl-ref-e1fd90e1326d50c530aebe1edbbbc7deae291194.tar.gz
crawl-ref-e1fd90e1326d50c530aebe1edbbbc7deae291194.zip
Merge r2815 (better hiding of secret doors)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2816 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/direct.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index 9e42a92e8d..96f8fc2d6b 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -1578,7 +1578,20 @@ std::string feature_description(int mx, int my, description_level_type dtype,
return (feature_do_grammar(
dtype, add_stop, false,
marker_feature_description(coord_def(mx, my))));
-
+ case DNGN_SECRET_DOOR:
+ {
+ // If we have neighbouring walls, try to look like them.
+ // Arguably we should go by our own colour, but well...
+ for ( int dx = -1; dx <= 1; ++dx )
+ for ( int dy = -1; dy <= 1; ++dy )
+ {
+ const dungeon_feature_type neighbour = grd[mx+dx][my+dy];
+ if ( grid_is_wall(neighbour) )
+ return feature_description(neighbour, NUM_TRAPS,
+ dtype, add_stop);
+ }
+ return (feature_description(grid, NUM_TRAPS, dtype, add_stop));
+ }
default:
return (feature_description(grid, NUM_TRAPS, dtype, add_stop));
}