From: PatR Date: Mon, 30 Nov 2015 05:46:24 +0000 (-0800) Subject: dungeon overview bug fixes X-Git-Tag: NetHack-3.6.0_RC01~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3903381a2d15915947f6afa3d00ef8aac108f0a9;p=nethack dungeon overview bug fixes Reported by a beta tester months ago: it was possible to recognize your god's temple on the Astral Plane by stepping into its doorway, since #overview would show "temple of " (only if just one temple had been entered and the altar in it was the only one you'd seen and it was for your own god; #overview doesn't show "temple of ", just "a temple"). After this fix it will just show "a temple" even when you can see the temple's altar, so #overview can't be used as a shortcut to finding the right temple. While testing the fix I discovered that amnesia wasn't handled when forgetting the current level's map, only when other levels got flagged as forgotten. The number of altars, fountains, and so on are recalculated when #overview is executed, so current-level amnesia worked for those. But data about known rooms is not recalculated, so the number of temples and shops you'd visited on the level stayed instead of being forgotten. The fix is a bit iffy for the case where you only forget random spots scattered across the level's map rather than the whole thing; this just wipes #overview memory of every room even if parts of rooms are still remembered. --- diff --git a/src/dungeon.c b/src/dungeon.c index 33843e95b..96b99591d 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 dungeon.c $NHDT-Date: 1446955297 2015/11/08 04:01:37 $ $NHDT-Branch: master $:$NHDT-Revision: 1.68 $ */ +/* NetHack 3.6 dungeon.c $NHDT-Date: 1448862377 2015/11/30 05:46:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.69 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1979,6 +1979,7 @@ get_annotation(lev) d_level *lev; { mapseen *mptr; + if ((mptr = find_mapseen(lev))) return mptr->custom; return NULL; @@ -2405,7 +2406,10 @@ recalc_mapseen() mptr->feat.ngrave = count; break; case ALTAR: - atmp = Amask2msa(levl[x][y].altarmask); + atmp = (Is_astralevel(&u.uz) + && (levl[x][y].seenv & SVALL) != SVALL) + ? MSA_NONE + : Amask2msa(levl[x][y].altarmask); if (!mptr->feat.naltar) mptr->feat.msalign = atmp; else if (mptr->feat.msalign != atmp) diff --git a/src/read.c b/src/read.c index 37867ee58..6f9b39a0b 100644 --- a/src/read.c +++ b/src/read.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 read.c $NHDT-Date: 1447987787 2015/11/20 02:49:47 $ $NHDT-Branch: master $:$NHDT-Revision: 1.123 $ */ +/* NetHack 3.6 read.c $NHDT-Date: 1448862378 2015/11/30 05:46:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.125 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -776,6 +776,8 @@ int howmuch; levl[zx][zy].glyph = cmap_to_glyph(S_stone); lastseentyp[zx][zy] = STONE; } + /* forget overview data for this level */ + forget_mapseen(ledger_no(&u.uz)); } /* Forget all traps on the level. */