trunk only: preserving context (src files)

Pat Rankin wrote:
> collect them all into some new struct and
> save that separately rather than jamming more non-option stuff
> into struct flags.

This patch:
- collects all context/tracking related fields from flags
  into a new structure called "context."
It also adds the following to the new structure:
- stethoscope turn support
- victual support
- tin support
This commit is contained in:
nethack.allison
2003-09-21 11:52:54 +00:00
parent 74b834c774
commit 22ce5ed6f2
58 changed files with 571 additions and 567 deletions

View File

@@ -674,8 +674,8 @@ struct monst *mon;
*m2 = *mon; /* copy condition of old monster */
m2->nmon = fmon;
fmon = m2;
m2->m_id = flags.ident++;
if (!m2->m_id) m2->m_id = flags.ident++; /* ident overflowed */
m2->m_id = context.ident++;
if (!m2->m_id) m2->m_id = context.ident++; /* ident overflowed */
m2->mx = mm.x;
m2->my = mm.y;
@@ -869,8 +869,8 @@ register int mmflags;
(void)memset((genericptr_t)mtmp->mextra, 0, xlth);
mtmp->nmon = fmon;
fmon = mtmp;
mtmp->m_id = flags.ident++;
if (!mtmp->m_id) mtmp->m_id = flags.ident++; /* ident overflowed */
mtmp->m_id = context.ident++;
if (!mtmp->m_id) mtmp->m_id = context.ident++; /* ident overflowed */
set_mon_data(mtmp, ptr, 0);
if (mtmp->data->msound == MS_LEADER)
quest_status.leader_m_id = mtmp->m_id;
@@ -975,13 +975,13 @@ register int mmflags;
}
} else if (mndx == PM_WIZARD_OF_YENDOR) {
mtmp->iswiz = TRUE;
flags.no_of_wizards++;
if (flags.no_of_wizards == 1 && Is_earthlevel(&u.uz))
context.no_of_wizards++;
if (context.no_of_wizards == 1 && Is_earthlevel(&u.uz))
mitem = SPE_DIG;
} else if (mndx == PM_DJINNI) {
flags.djinni_count++;
context.djinni_count++;
} else if (mndx == PM_GHOST) {
flags.ghost_count++;
context.ghost_count++;
if (!(mmflags & MM_NONAME))
mtmp = christen_monst(mtmp, rndghostname());
} else if (mndx == PM_VLAD_THE_IMPALER) {