avoid any potential hassle with C23 unreachable macro
This commit is contained in:
@@ -214,7 +214,7 @@ typedef struct mapseen {
|
|||||||
Bitfield(shoptype, 5);
|
Bitfield(shoptype, 5);
|
||||||
} feat;
|
} feat;
|
||||||
struct mapseen_flags {
|
struct mapseen_flags {
|
||||||
Bitfield(unreachable, 1); /* can't get back to this level */
|
Bitfield(notreachable, 1); /* can't get back to this level */
|
||||||
Bitfield(forgot, 1); /* player has forgotten about this level */
|
Bitfield(forgot, 1); /* player has forgotten about this level */
|
||||||
Bitfield(knownbones, 1); /* player aware of bones */
|
Bitfield(knownbones, 1); /* player aware of bones */
|
||||||
Bitfield(oracle, 1);
|
Bitfield(oracle, 1);
|
||||||
|
|||||||
@@ -2175,7 +2175,7 @@ tport_menu(
|
|||||||
char *entry,
|
char *entry,
|
||||||
struct lchoice *lchoices,
|
struct lchoice *lchoices,
|
||||||
d_level *lvl_p,
|
d_level *lvl_p,
|
||||||
boolean unreachable)
|
boolean cannotreach)
|
||||||
{
|
{
|
||||||
char tmpbuf[BUFSZ];
|
char tmpbuf[BUFSZ];
|
||||||
anything any;
|
anything any;
|
||||||
@@ -2185,7 +2185,7 @@ tport_menu(
|
|||||||
lchoices->dgn[lchoices->idx] = lvl_p->dnum;
|
lchoices->dgn[lchoices->idx] = lvl_p->dnum;
|
||||||
lchoices->playerlev[lchoices->idx] = depth(lvl_p);
|
lchoices->playerlev[lchoices->idx] = depth(lvl_p);
|
||||||
any = cg.zeroany;
|
any = cg.zeroany;
|
||||||
if (unreachable) {
|
if (cannotreach) {
|
||||||
/* not selectable, but still consumes next menuletter;
|
/* not selectable, but still consumes next menuletter;
|
||||||
prepend padding in place of missing menu selector */
|
prepend padding in place of missing menu selector */
|
||||||
Sprintf(tmpbuf, " %s", entry);
|
Sprintf(tmpbuf, " %s", entry);
|
||||||
@@ -2785,7 +2785,7 @@ RESTORE_WARNING_FORMAT_NONLITERAL
|
|||||||
|
|
||||||
/* Remove all mapseen objects for a particular dnum.
|
/* Remove all mapseen objects for a particular dnum.
|
||||||
* Useful during quest expulsion to remove quest levels.
|
* Useful during quest expulsion to remove quest levels.
|
||||||
* [No longer deleted, just marked as unreachable. #overview will
|
* [No longer deleted, just marked as notreachable. #overview will
|
||||||
* ignore such levels, end of game disclosure will include them.]
|
* ignore such levels, end of game disclosure will include them.]
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@@ -2797,7 +2797,7 @@ remdun_mapseen(int dnum)
|
|||||||
while ((mptr = *mptraddr) != 0) {
|
while ((mptr = *mptraddr) != 0) {
|
||||||
if (mptr->lev.dnum == dnum) {
|
if (mptr->lev.dnum == dnum) {
|
||||||
#if 1 /* use this... */
|
#if 1 /* use this... */
|
||||||
mptr->flags.unreachable = 1;
|
mptr->flags.notreachable = 1;
|
||||||
}
|
}
|
||||||
#else /* old deletion code */
|
#else /* old deletion code */
|
||||||
*mptraddr = mptr->next;
|
*mptraddr = mptr->next;
|
||||||
@@ -2862,7 +2862,7 @@ interest_mapseen(mapseen *mptr)
|
|||||||
{
|
{
|
||||||
if (on_level(&u.uz, &mptr->lev))
|
if (on_level(&u.uz, &mptr->lev))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (mptr->flags.unreachable || mptr->flags.forgot)
|
if (mptr->flags.notreachable || mptr->flags.forgot)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
/* when in tutorial, show all tutorial levels visited whether interesting
|
/* when in tutorial, show all tutorial levels visited whether interesting
|
||||||
or not and don't show any other levels; when outside tutorial, don't
|
or not and don't show any other levels; when outside tutorial, don't
|
||||||
@@ -2889,7 +2889,7 @@ interest_mapseen(mapseen *mptr)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
/* when in the endgame, list all endgame levels visited, whether they
|
/* when in the endgame, list all endgame levels visited, whether they
|
||||||
have annotations or not, so that #overview doesn't become extremely
|
have annotations or not, so that #overview doesn't become extremely
|
||||||
sparse once the rest of the dungeon has been flagged as unreachable */
|
sparse once the rest of the dungeon has been flagged as notreachable */
|
||||||
if (In_endgame(&u.uz))
|
if (In_endgame(&u.uz))
|
||||||
return (boolean) In_endgame(&mptr->lev);
|
return (boolean) In_endgame(&mptr->lev);
|
||||||
/* level is of interest if it has non-zero feature count or known bones
|
/* level is of interest if it has non-zero feature count or known bones
|
||||||
@@ -3075,17 +3075,17 @@ recalc_mapseen(void)
|
|||||||
/* reset all features; mptr->feat.* = 0; */
|
/* reset all features; mptr->feat.* = 0; */
|
||||||
(void) memset((genericptr_t) &mptr->feat, 0, sizeof mptr->feat);
|
(void) memset((genericptr_t) &mptr->feat, 0, sizeof mptr->feat);
|
||||||
/* reset most flags; some level-specific ones are left as-is */
|
/* reset most flags; some level-specific ones are left as-is */
|
||||||
if (mptr->flags.unreachable) {
|
if (mptr->flags.notreachable) {
|
||||||
mptr->flags.unreachable = 0; /* reached it; Eye of the Aethiopica? */
|
mptr->flags.notreachable = 0; /* reached it; Eye of the Aethiopica? */
|
||||||
if (In_quest(&u.uz)) {
|
if (In_quest(&u.uz)) {
|
||||||
mapseen *mptrtmp = svm.mapseenchn;
|
mapseen *mptrtmp = svm.mapseenchn;
|
||||||
|
|
||||||
/* when quest was unreachable due to ejection and portal removal,
|
/* when quest was notreachable due to ejection and portal removal,
|
||||||
getting back to it via arti-invoke should revive annotation
|
getting back to it via arti-invoke should revive annotation
|
||||||
data for all quest levels, not just the one we're on now */
|
data for all quest levels, not just the one we're on now */
|
||||||
do {
|
do {
|
||||||
if (mptrtmp->lev.dnum == mptr->lev.dnum)
|
if (mptrtmp->lev.dnum == mptr->lev.dnum)
|
||||||
mptrtmp->flags.unreachable = 0;
|
mptrtmp->flags.notreachable = 0;
|
||||||
mptrtmp = mptrtmp->next;
|
mptrtmp = mptrtmp->next;
|
||||||
} while (mptrtmp);
|
} while (mptrtmp);
|
||||||
}
|
}
|
||||||
@@ -3628,7 +3628,7 @@ print_mapseen(
|
|||||||
Sprintf(buf, "%sA primitive area.", PREFIX);
|
Sprintf(buf, "%sA primitive area.", PREFIX);
|
||||||
} else if (on_level(&mptr->lev, &qstart_level)) {
|
} else if (on_level(&mptr->lev, &qstart_level)) {
|
||||||
Sprintf(buf, "%sHome%s.", PREFIX,
|
Sprintf(buf, "%sHome%s.", PREFIX,
|
||||||
mptr->flags.unreachable ? " (no way back...)" : "");
|
mptr->flags.notreachable ? " (no way back...)" : "");
|
||||||
if (u.uevent.qcompleted)
|
if (u.uevent.qcompleted)
|
||||||
Sprintf(buf, "%sCompleted quest for %s.", PREFIX, ldrname());
|
Sprintf(buf, "%sCompleted quest for %s.", PREFIX, ldrname());
|
||||||
else if (mptr->flags.questing)
|
else if (mptr->flags.questing)
|
||||||
|
|||||||
Reference in New Issue
Block a user