diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-10-06 15:23:57 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-10-06 15:30:04 +0200 |
commit | 03bfcc8f827d2330a6d58ce4e1f4b0f971b3ad20 (patch) | |
tree | 65a897b791c9d438ff1d0327701042eecd9bdc5d /crawl-ref/source/view.cc | |
parent | f844dbe31ff14cbd33b343a11a2c6587d80f79ef (diff) | |
download | crawl-ref-03bfcc8f827d2330a6d58ce4e1f4b0f971b3ad20.tar.gz crawl-ref-03bfcc8f827d2330a6d58ce4e1f4b0f971b3ad20.zip |
Fix an info leak with passive mapping.
By comparing the mapped/non-mapped pattern you could tell where on the
level are you, if boundaries are not yet known.
This commit introduces per-game hash seeds. Weak monster invisibility
already uses something similar, except for it being per-turn.
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r-- | crawl-ref/source/view.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index a25907df7d..73635ad89c 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -390,7 +390,8 @@ static const FixedArray<uint8_t, GXM, GYM>& _tile_difficulties(bool random) } // must not produce the magic value (-1) - int seed = (static_cast<int>(you.where_are_you) << 8) + you.depth; + int seed = (static_cast<int>(you.where_are_you) << 8) + you.depth + ^ you.game_seeds[SEED_PASSIVE_MAP] & 0x7fffffff; if (seed == cache_seed) return cache; |