Make special levels generate objects with genocided monster classes

If a special level explicitly requests eg. a statue with a genocided
monster class, allow generating it.

Rationale is that those objects were generated before the monsters
became extinct. Also fixes a lua error.
This commit is contained in:
Pasi Kallinen
2020-03-08 14:03:47 +02:00
parent 7b226a12cb
commit f18b5bb59b
4 changed files with 7 additions and 3 deletions

View File

@@ -1592,7 +1592,7 @@ int mndx, mvflagsmask, genomask;
{
struct permonst *ptr = &mons[mndx];
if (g.mvitals[mndx].mvflags & mvflagsmask)
if ((g.mvitals[mndx].mvflags & mvflagsmask) && !(genomask & G_IGNORE))
return FALSE;
if (ptr->geno & genomask)
return FALSE;
@@ -1627,6 +1627,7 @@ aligntyp atyp;
{
register int first, last, num = 0;
int k, nums[SPECIAL_PM + 1]; /* +1: insurance for final return value */
int ignore = (spc & G_IGNORE);
int maxmlev, mask = (G_NOGEN | G_UNIQ) & ~spc;
(void) memset((genericptr_t) nums, 0, sizeof nums);
@@ -1655,7 +1656,7 @@ aligntyp atyp;
for (last = first; last < SPECIAL_PM && mons[last].mlet == class; last++) {
if (atyp != A_NONE && sgn(mons[last].maligntyp) != sgn(atyp))
continue;
if (mk_gen_ok(last, G_GONE, mask)) {
if (mk_gen_ok(last, G_GONE, mask|ignore)) {
/* consider it; don't reject a toostrong() monster if we
don't have anything yet (num==0) or if it is the same
(or lower) difficulty as preceding candidate (non-zero

View File

@@ -3313,7 +3313,7 @@ lua_State *L;
if (montype) {
if (strlen(montype) == 1
&& def_char_to_monclass(*montype) != MAXMCLASSES) {
pm = mkclass(def_char_to_monclass(*montype), G_NOGEN);
pm = mkclass(def_char_to_monclass(*montype), G_NOGEN|G_IGNORE);
} else {
for (i = LOW_PM; i < NUMMONS; i++)
if (!strcmpi(mons[i].mname, montype)) {