]> granicus.if.org Git - nethack/commit
mons[0]
authorPatR <rankin@nethack.org>
Sun, 16 Jul 2017 22:28:44 +0000 (15:28 -0700)
committerPatR <rankin@nethack.org>
Sun, 16 Jul 2017 22:28:44 +0000 (15:28 -0700)
commit27f9a83a0b9055073533d8f638342be7ff2faf36
treea26dd03c06b05e483c31df84f6e370df9bd67c04
parentd17858f9479603db62107346a0edb7ba875ea355
mons[0]

Alex mentioned that loops over mons[] were starting at [0], which
should be [LOW_PM] instead.  I only found two, and the mvitals[] one
was benign.  The special level one might have been too, depending
upon spec_lev's thoroughness--I didn't attempt to check.

Once upon a time there was a possibility of moving 'playermon' from
a separate variable to mons[0], so LOW_PM became the index of the
first valid monster.  Instead, 'playermon' went away altogether.
LOW_PM (and NON_PM) could go away too, but I don't see how reverting
to hardcoded 0 and -1 would be an improvement.  We have enough
problems as it is with "giant ant" turning up in unexpected places
because someone used 0 instead of NON_PM to mean "none of the above".
src/allmain.c
src/sp_lev.c