From ac738ba838f899d98ff0570e1070cdd62d6b77c5 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 24 Oct 2007 14:05:13 +0000 Subject: Add a "forget level map" command, Ctrl-F, to level map. This command used to be for waypoints along with Ctrl-W but as that never made it into the level map help I don't think it matters. (FR 1745112) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2537 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index af1a809c48..e36a13035e 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2574,19 +2574,24 @@ bool you_resist_magic(int power) return 1; */ } -void forget_map(unsigned char chance_forgotten) +// force is true for forget_map command on level map +void forget_map(unsigned char chance_forgotten, bool force) { - unsigned char xcount, ycount = 0; + if ( force && !yesno("Really forget level map?", true, 'n') ) + return; - for (xcount = 0; xcount < GXM; xcount++) + for (unsigned char xcount = 0; xcount < GXM; xcount++) { - for (ycount = 0; ycount < GYM; ycount++) + for (unsigned char ycount = 0; ycount < GYM; ycount++) { - if (random2(100) < chance_forgotten) - env.map[xcount][ycount].clear(); + if (!see_grid(xcount, ycount) && + (force || random2(100) < chance_forgotten)) + { + env.map[xcount][ycount].clear(); + } } } -} // end forget_map() +} // end forget_map() void gain_exp( unsigned int exp_gained, unsigned int* actual_gain, unsigned int* actual_avail_gain) -- cgit v1.2.3-54-g00ecf