Mimic in a health food store could cause a panic

Health food stores use a special "vegetarian class" of items,
which mkobj doesn't understand. Just make the mimic use a random
item class in that case.
This commit is contained in:
Pasi Kallinen
2020-04-15 11:02:33 +03:00
parent 02f222bc0c
commit fe8f18c5d7
2 changed files with 3 additions and 2 deletions

View File

@@ -2216,7 +2216,7 @@ register struct monst *mtmp;
ap_type = M_AP_OBJECT;
appear = -s_sym;
} else {
if (s_sym == RANDOM_CLASS)
if (s_sym == RANDOM_CLASS || s_sym >= MAXOCLASSES)
s_sym = syms[rn2((int) sizeof(syms) - 2) + 2];
goto assign_sym;
}

View File

@@ -802,7 +802,8 @@ struct obj *obj;
return FALSE;
}
/* positive value: class; negative value: specific object type */
/* positive value: class; negative value: specific object type.
can also return non-existing object class (eg. VEGETARIAN_CLASS) */
int
get_shop_item(type)
int type;