monster birth limits exceeded by bones load

Bones loading was only checking to see if a
monster was marked extinct, it wasn't adding
up the born count of a species in the current
game with the number of that species on the
bones level being loaded. That made it possible
to exceed the correct number of nazgul and
erinys via bones.

This adds a common routine called propagate()
that makemon() and restmonchn(ghostly) share,
for incrementing the born count and checking for
extinction, etc.

When a bones level is loaded, restmonchn()
will flag an illegal monster (duplicated unique,
or too many of a species) by setting the
individual monster's mhpmax to the cookie
value DEFUNCT_MONSTER. Before getbones() finishes
loading the bones level, it will purge those
monsters from the chain.
This commit is contained in:
nethack.allison
2003-09-05 20:39:35 +00:00
parent 724ac2670c
commit 237a8fbce7
6 changed files with 63 additions and 38 deletions

View File

@@ -142,6 +142,9 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
#define MM_IGNOREWATER 0x80 /* ignore water when positioning */
#define MM_ADJACENTOK 0x100 /* it is acceptable to use adjacent coordinates */
/* special mhpmax value when loading bones monster to flag as extinct or genocided */
#define DEFUNCT_MONSTER (-100)
/* flags for special ggetobj status returns */
#define ALL_FINISHED 0x01 /* called routine already finished the job */