replace the mimic-as-monster fix
The new EXTRA_SANITY_CHECK for a monster mimicking a monster. It falsely triggered if the hero was hallucinating. Just add an assertion that the monster index is within valid range.
This commit is contained in:
+4
-9
@@ -6101,17 +6101,12 @@ that_is_a_mimic(
|
|||||||
}
|
}
|
||||||
} else if (glyph_is_monster(glyph)) {
|
} else if (glyph_is_monster(glyph)) {
|
||||||
const char *mtmp_name;
|
const char *mtmp_name;
|
||||||
int sym = glyph_to_mon(glyph);
|
int mndx = glyph_to_mon(glyph);
|
||||||
|
|
||||||
#ifdef EXTRA_SANITY_CHECKS
|
assert(mndx >= LOW_PM && mndx <= HIGH_PM);
|
||||||
if (iflags.sanity_check && (int) mtmp->mappearance != sym)
|
mtmp_name = pmname(&mons[mndx], Mgender(mtmp));
|
||||||
impossible("mimic appearance %u does not match"
|
|
||||||
" monster #%d (glyph=%d)",
|
|
||||||
mtmp->mappearance, sym, glyph);
|
|
||||||
#endif
|
|
||||||
mtmp_name = pmname(&mons[sym], Mgender(mtmp));
|
|
||||||
Snprintf(fmtbuf, sizeof fmtbuf,
|
Snprintf(fmtbuf, sizeof fmtbuf,
|
||||||
"Wait! That %s is %%s!", mtmp_name);
|
"Wait! That %s is really %%s!", mtmp_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cloned Wiz starts out mimicking some other monster and
|
/* cloned Wiz starts out mimicking some other monster and
|
||||||
|
|||||||
Reference in New Issue
Block a user