From: PatR Date: Mon, 19 Apr 2021 00:34:26 +0000 (-0700) Subject: another scrambled message when given '-' as object X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d2c584c961d4328044f587b1135eef216146d45;p=nethack another scrambled message when given '-' as object This is similar to commit 98d381de46c47325abbdafda7894238c59f18cb8 (which mis-classified the bug as post-3.6), using #rub on a lump of royal jelly and supplying '-' rather than an egg as the target yielded "You mime rub the royal jellying on something." Change it to be "You mime rubbing the royal jelly on something." --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 207845c46..3f655dcb4 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -410,6 +410,8 @@ remove superfluous "All" from "All foos are already nonexistent." when blessed genocide tries to remove something which has already been genocided "#dip into -" produced a scrambled message: You mime dip intoing something. +similarly, "#rub the royal jelly on -" produced + You mime rub the royal jellying on something. mounted hero falling out of saddle shouldn't hit ground and take damage when levitating or flying (if done without steed's help) avoid "obj not free" panic if monster kills itself by reading scroll of earth diff --git a/src/invent.c b/src/invent.c index 7a4c118e5..4da50ea8d 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1427,10 +1427,12 @@ mime_action(const char *word) *bp = '\0'; sfx = (bp + 1); /* "something " */ } - if (!strncmp(buf, "dip ", 4) && strstr(buf + 4, " into")) { - /* "dip into" => "dipping into" */ + if ((!strncmp(buf, "rub the ", 8) && strstr(buf + 8, " on")) + || (!strncmp(buf, "dip ", 4) && strstr(buf + 4, " into"))) { + /* "rub the royal jelly on" -> "rubbing the royal jelly on", or + "dip into" => "dipping into" */ buf[3] = '\0'; - pfx = &buf[4]; /* " something" */ + pfx = &buf[3 + 1]; /* " something" */ } if ((bp = strstr(buf, " or ")) != 0) { *bp = '\0';