Skip to content

Commit f280ae6

Browse files
committed
Properly display fractured altars in dungeon overview.
Should have done this before making version 0.9.0 available for public play, as this commit is save-breaking. Better late than never.
1 parent 461e8c9 commit f280ae6

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

doc/evilhack-changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -4376,4 +4376,5 @@ The following changes to date are:
43764376
- Latest merges from 'vanilla' NetHack 3.6.7 official release (as of
43774377
November 6th, 2024)
43784378
- Initial preparation for new version (0.9.1)
4379+
- Properly display fractured altars in dungeon overview
43794380

include/dungeon.h

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ typedef struct mapseen {
227227
Bitfield(nfount, 2);
228228
Bitfield(nsink, 2);
229229
Bitfield(naltar, 2);
230+
Bitfield(nfaltar, 2);
230231
Bitfield(nthrone, 2);
231232

232233
Bitfield(ngrave, 2);

src/dungeon.c

+31-10
Original file line numberDiff line numberDiff line change
@@ -2403,9 +2403,9 @@ d_level *lev;
24032403

24042404
#define INTEREST(feat) \
24052405
((feat).nfount || (feat).nsink || (feat).nthrone || (feat).naltar \
2406-
|| (feat).ngrave || (feat).ntree || (feat).nshop || (feat).ntemple \
2407-
|| (feat).nforge || (feat).ndeadtree || (feat).ngrass \
2408-
|| (feat).nsand || (feat).nmagicchest)
2406+
|| (feat).nfaltar || (feat).ngrave || (feat).ntree || (feat).nshop \
2407+
|| (feat).ntemple || (feat).nforge || (feat).ndeadtree \
2408+
|| (feat).ngrass || (feat).nsand || (feat).nmagicchest)
24092409
/* || (feat).water || (feat).ice || (feat).lava */
24102410

24112411
/* returns true if this level has something interesting to print out */
@@ -2651,13 +2651,23 @@ recalc_mapseen()
26512651
&& (levl[x][y].seenv & SVALL) != SVALL)
26522652
? MSA_NONE
26532653
: Amask2msa(levl[x][y].altarmask);
2654-
if (!mptr->feat.naltar)
2655-
mptr->feat.msalign = atmp;
2656-
else if (mptr->feat.msalign != atmp)
2657-
mptr->feat.msalign = MSA_NONE;
2658-
count = mptr->feat.naltar + 1;
2659-
if (count <= 3)
2660-
mptr->feat.naltar = count;
2654+
if (levl[x][y].frac_altar == 1) {
2655+
if (!mptr->feat.nfaltar)
2656+
mptr->feat.msalign = atmp;
2657+
else if (mptr->feat.msalign != atmp)
2658+
mptr->feat.msalign = MSA_NONE;
2659+
count = mptr->feat.nfaltar + 1;
2660+
if (count <= 3)
2661+
mptr->feat.nfaltar = count;
2662+
} else {
2663+
if (!mptr->feat.naltar)
2664+
mptr->feat.msalign = atmp;
2665+
else if (mptr->feat.msalign != atmp)
2666+
mptr->feat.msalign = MSA_NONE;
2667+
count = mptr->feat.naltar + 1;
2668+
if (count <= 3)
2669+
mptr->feat.naltar = count;
2670+
}
26612671
break;
26622672
/* An automatic annotation is added to the Castle and
26632673
* to Fort Ludios once their structure's main entrance
@@ -3078,6 +3088,17 @@ boolean printdun;
30783088
&& (u.ualign.type != A_NONE || mptr->feat.naltar == 1))
30793089
Sprintf(eos(buf), " to %s", align_gname(u.ualign.type));
30803090
}
3091+
if (mptr->feat.nfaltar > 0) {
3092+
/* same for fractured altars */
3093+
if (mptr->feat.ntemple != mptr->feat.nfaltar)
3094+
ADDNTOBUF("fractured altar", mptr->feat.nfaltar);
3095+
else
3096+
ADDNTOBUF("temple", mptr->feat.ntemple);
3097+
3098+
if (Amask2align(Msa2amask(mptr->feat.msalign)) == u.ualign.type
3099+
&& (u.ualign.type != A_NONE || mptr->feat.nfaltar == 1))
3100+
Sprintf(eos(buf), " to %s", align_gname(u.ualign.type));
3101+
}
30813102
ADDNTOBUF("throne", mptr->feat.nthrone);
30823103
ADDNTOBUF("forge", mptr->feat.nforge);
30833104
ADDNTOBUF("magic chest", mptr->feat.nmagicchest);

0 commit comments

Comments
 (0)