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:
20
src/bones.c
20
src/bones.c
@@ -422,21 +422,21 @@ getbones()
|
||||
trickery(errbuf);
|
||||
} else {
|
||||
register struct monst *mtmp;
|
||||
int mndx;
|
||||
|
||||
getlev(fd, 0, 0, TRUE);
|
||||
|
||||
/* to correctly reset named artifacts on the level and
|
||||
to keep tabs on unique monsters like demon lords */
|
||||
/* Note that getlev() now keeps tabs on unique
|
||||
* monsters such as demon lords, and tracks the
|
||||
* birth counts of all species just as makemon()
|
||||
* does. If a bones monster is extinct or has been
|
||||
* subject to genocide, their mhpmax will be
|
||||
* set to the magic DEFUNCT_MONSTER cookie value.
|
||||
*/
|
||||
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
||||
mndx = monsndx(mtmp->data);
|
||||
if (mvitals[mndx].mvflags & G_EXTINCT) {
|
||||
mongone(mtmp);
|
||||
} else {
|
||||
if (mons[mndx].geno & G_UNIQ)
|
||||
mvitals[mndx].mvflags |= G_EXTINCT;
|
||||
if (mtmp->mhpmax == DEFUNCT_MONSTER) mongone(mtmp);
|
||||
else
|
||||
/* to correctly reset named artifacts on the level */
|
||||
resetobjs(mtmp->minvent,TRUE);
|
||||
}
|
||||
}
|
||||
resetobjs(fobj,TRUE);
|
||||
resetobjs(level.buriedobjlist,TRUE);
|
||||
|
||||
Reference in New Issue
Block a user