From: Pasi Kallinen Date: Sat, 26 Jun 2021 10:00:32 +0000 (+0300) Subject: Fix strange object mimic in shop sanity error X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5dd0f89869f237c5ded275c74c5cc664c92caff;p=nethack Fix strange object mimic in shop sanity error Shop population code set the mimic shape to strange object without checking for protection from shape changers. Let set_mimic_sym (via makemon) handle it correctly instead. --- diff --git a/src/makemon.c b/src/makemon.c index b2900db9b..5ed63ab64 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -2212,6 +2212,10 @@ set_mimic_sym(register struct monst *mtmp) */ } else if (rt >= SHOPBASE) { + if (rn2(10) >= depth(&u.uz)) { + s_sym = S_MIMIC_DEF; /* -> STRANGE_OBJECT */ + goto assign_sym; + } s_sym = get_shop_item(rt - SHOPBASE); if (s_sym < 0) { ap_type = M_AP_OBJECT; diff --git a/src/shknam.c b/src/shknam.c index ecba17993..2f7e1998c 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -463,11 +463,7 @@ mkshobj_at(const struct shclass* shp, int sx, int sy, boolean mkspecl) if (rn2(100) < depth(&u.uz) && !MON_AT(sx, sy) && (ptr = mkclass(S_MIMIC, 0)) != 0 && (mtmp = makemon(ptr, sx, sy, NO_MM_FLAGS)) != 0) { - /* note: makemon will set the mimic symbol to a shop item */ - if (rn2(10) >= depth(&u.uz)) { - mtmp->m_ap_type = M_AP_OBJECT; - mtmp->mappearance = STRANGE_OBJECT; - } + /* nothing */ } else { atype = get_shop_item((int) (shp - shtypes)); if (atype == VEGETARIAN_CLASS)