]> granicus.if.org Git - nethack/commitdiff
another scrambled message when given '-' as object
authorPatR <rankin@nethack.org>
Mon, 19 Apr 2021 00:34:26 +0000 (17:34 -0700)
committerPatR <rankin@nethack.org>
Mon, 19 Apr 2021 00:34:26 +0000 (17:34 -0700)
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."

doc/fixes37.0
src/invent.c

index 207845c46af4520d03107f77e882c86f5376e34e..3f655dcb4b3cb678a82ba56bdf73820536491c33 100644 (file)
@@ -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 <item> into -" produced a scrambled message:
        You mime dip <item> 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
index 7a4c118e5852e6a7a6b74d4117d4f95dfc391681..4da50ea8dd26cb384a613ee551f9694801c4bc79 100644 (file)
@@ -1427,10 +1427,12 @@ mime_action(const char *word)
         *bp = '\0';
         sfx = (bp + 1); /* "something <sfx>" */
     }
-    if (!strncmp(buf, "dip ", 4) && strstr(buf + 4, " into")) {
-        /* "dip <foo> into" => "dipping <foo> 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 <foo> into" => "dipping <foo> into" */
         buf[3] = '\0';
-        pfx = &buf[4]; /* "<pfx> something" */
+        pfx = &buf[3 + 1]; /* "<pfx> something" */
     }
     if ((bp = strstr(buf, " or ")) != 0) {
         *bp = '\0';