hero infravision

Take a first step towards making the mons[] array be readonly.
The only other place that updates it is when changing succubus and
incubus AD_SSEX attacks to AD_SEDU ones and that can be handled
via existing getmattk(), but so far has proven to be trickier than
anticipated.
This commit is contained in:
PatR
2019-01-09 18:10:55 -08:00
parent 6e108962cb
commit bb86fa2bb7
3 changed files with 17 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 role.c $NHDT-Date: 1546137492 2018/12/30 02:38:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.55 $ */
/* NetHack 3.6 role.c $NHDT-Date: 1547086250 2019/01/10 02:10:50 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.56 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2098,6 +2098,14 @@ role_init()
/* 0 or 1; no gods are neuter, nor is gender randomized */
quest_status.godgend = !strcmpi(align_gtitle(alignmnt), "goddess");
#if 0
/*
* Disable this fixup so that mons[] can be const. The only
* place where it actually matters for the hero is in set_uasmon()
* and that can use mons[race] rather than mons[role] for this
* particular property. Despite the comment, it is checked--where
* needed--via instrinsic 'Infravision' which set_uasmon() manages.
*/
/* Fix up infravision */
if (mons[urace.malenum].mflags3 & M3_INFRAVISION) {
/* although an infravision intrinsic is possible, infravision
@@ -2113,6 +2121,7 @@ role_init()
if (urole.femalenum != NON_PM)
mons[urole.femalenum].mflags3 |= M3_INFRAVISION;
}
#endif /*0*/
/* Artifacts are fixed in hack_artifacts() */