diff options
author | Neil Moore <neil@s-z.org> | 2014-02-09 12:28:55 -0500 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2014-02-09 12:28:55 -0500 |
commit | 6f90349bad97b8ab6c0e174b0f42d0346b493520 (patch) | |
tree | 024900e45c4c78f04afd120ff8f6df6434f66252 /crawl-ref/source/directn.cc | |
parent | 151ae2ed11f6aa3622d12e55c9c71861c29e77c5 (diff) | |
download | crawl-ref-6f90349bad97b8ab6c0e174b0f42d0346b493520.tar.gz crawl-ref-6f90349bad97b8ab6c0e174b0f42d0346b493520.zip |
Don't leak information on out-of-sight squares in xv (#8109)
This allowed you to identify altars and portals detected by magic
mapping, even though map_knowledge explicitly had DNGN_UNKNOWN_ALTAR.
Even worse, xv on an unseen (even unmapped) region of the level would
tell you exactly what feature was that that spot.
This used to be prevented by xv only working in LOS. Now we check
whether the real feature is the same as the remembered one, and if
not use the base description for the remembered feature. If they
were the same, we look up the raw_feature_description for the
location, so that vault feature renames are applied.
The solution isn't perfect: it still can still leak whether a remembered
square has changed, detectable by the lack of feature renames (so only
in a few rare locations). Probably map_knowledge needs to store the
rename as well to fix that issue.
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r-- | crawl-ref/source/directn.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 651e9740b9..5f2ffe1edc 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -3420,8 +3420,11 @@ string feature_description_at(const coord_def& where, bool covering, dtype = DESC_THE; // fallthrough default: + const string featdesc = grid == grd(where) + ? raw_feature_description(where) + : _base_feature_desc(grid, get_trap_type(where)); return thing_do_grammar(dtype, add_stop, feat_is_trap(grid), - raw_feature_description(where) + covering_description); + featdesc + covering_description); } } |