From c099e0a1ffbd16de41860cfa7dc10681d829d69f Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 19 Oct 2019 12:05:33 -0400 Subject: [PATCH] grammar fix for "That walking shoes is really a small mimic" --- doc/fixes36.3 | 2 ++ include/extern.h | 1 + src/apply.c | 11 +++++++++-- src/mkobj.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index b787a3c1e..dee5b5b40 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -200,6 +200,8 @@ in a shop which doesn't care about tools: You drop a containing 1 item. offers you for your items in your . Sell them? [plural 'items' and 'them' were including the box along with the one item in it even though shk was only offering to buy its contents] +grammar correction for "That walking shoes is really a small mimic" when + applying a stethoscope Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/include/extern.h b/include/extern.h index e2fd85dca..8552e195f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1379,6 +1379,7 @@ E struct obj *FDECL(obj_nexto_xy, (struct obj *, int, int, BOOLEAN_P)); E struct obj *FDECL(obj_absorb, (struct obj **, struct obj **)); E struct obj *FDECL(obj_meld, (struct obj **, struct obj **)); E void FDECL(pudding_merge_message, (struct obj *, struct obj *)); +E struct obj *FDECL(init_dummyobj, (struct obj *, SHORT_P, long)); /* ### mkroom.c ### */ diff --git a/src/apply.c b/src/apply.c index 11bd09d03..3c11c6114 100644 --- a/src/apply.c +++ b/src/apply.c @@ -383,10 +383,15 @@ register struct obj *obj; newsym(mtmp->mx, mtmp->my); } else if (mtmp->mappearance) { const char *what = "thing"; + boolean use_plural = FALSE; + struct obj dummyobj, *odummy; switch (M_AP_TYPE(mtmp)) { case M_AP_OBJECT: - what = simple_typename(mtmp->mappearance); + odummy = init_dummyobj(&dummyobj, mtmp->mappearance, 1L); + what = simple_typename(odummy->otyp); + use_plural = (is_boots(odummy) || is_gloves(odummy) + || odummy->otyp == LENSES); break; case M_AP_MONSTER: /* ignore Hallucination here */ what = mons[mtmp->mappearance].mname; @@ -396,7 +401,9 @@ register struct obj *obj; break; } seemimic(mtmp); - pline("That %s is really %s.", what, mnm); + pline("%s %s %s really %s.", + use_plural ? "Those" : "That", what, + use_plural ? "are" : "is", mnm); } else if (flags.verbose && !canspotmon(mtmp)) { There("is %s there.", mnm); } diff --git a/src/mkobj.c b/src/mkobj.c index 6975ca966..6f5abbcc0 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -2470,6 +2470,38 @@ struct monst *mon; } } +/* + * Initialize a dummy obj with just enough info + * to allow some of the tests in obj.h that + * take an obj pointer to work. + * + */ +struct obj * +init_dummyobj(obj, otyp, oquan) +struct obj *obj; +short otyp; +long oquan; +{ + if (obj) { + *obj = zeroobj; + obj->otyp = otyp; + obj->oclass = objects[otyp].oc_class; + /* obj->dknown = 0; */ + /* suppress known except for amulets (needed for fakes and real A-of-Y) */ + obj->known = (obj->oclass == AMULET_CLASS) + ? obj->known + /* default is "on" for types which don't use it */ + : !objects[otyp].oc_uses_known; + obj->quan = oquan ? oquan : 1L; + obj->corpsenm = NON_PM; /* suppress statue and figurine details */ + /* but suppressing fruit details leads to "bad fruit #0" + [perhaps we should force "slime mold" rather than use xname?] */ + if (obj->otyp == SLIME_MOLD) + obj->spe = 1; + } + return obj; +} + /* obj sanity check: check objects inside container */ STATIC_OVL void check_contained(container, mesg)