Another (latent) case of an artifact possibly being generated and
immediately deleted: part of the process of a mimic disguising itself as
an item involves generating a random object, then deleting it. If this
item is a box or sack, it will generate with random contents, which will
be deleted along with the container. If artifacts are allowed as random
box contents, this can silently remove an artifact from being available
in the game.
This is effectively blocked already, since none of the artifacts
eligible for random generation are items from classes marked as valid
box contents (see boxiprobs[] in mkobj.c). Nonetheless, formally
preventing artifacts from generating as box contents will guarantee this
issue won't crop up if a randomly generated artifact tool, ring, etc, is
added in the future.
for (n = rn2(n + 1); n > 0; n--) {
if (box->otyp == ICE_BOX) {
- otmp = mksobj(CORPSE, TRUE, TRUE);
+ otmp = mksobj(CORPSE, TRUE, FALSE);
/* Note: setting age to 0 is correct. Age has a different
* from usual meaning for objects stored in ice boxes. -KAA
*/
for (tprob = rnd(100); (tprob -= iprobs->iprob) > 0; iprobs++)
;
- if (!(otmp = mkobj(iprobs->iclass, TRUE)))
+ if (!(otmp = mkobj(iprobs->iclass, FALSE)))
continue;
/* handle a couple of special cases */