]> granicus.if.org Git - nethack/commitdiff
More C343-108: Handle "rub on the stone"
authorPasi Kallinen <paxed@alt.org>
Sat, 21 Mar 2015 09:03:54 +0000 (11:03 +0200)
committerPasi Kallinen <paxed@alt.org>
Sat, 21 Mar 2015 09:03:54 +0000 (11:03 +0200)
src/invent.c

index 66e7e73075f4a9991169de5fdbc65b86bc44a211..12f0ef1b3e3e65bf7b52bc9dd18c48f95fc5e3d6 100644 (file)
@@ -973,12 +973,18 @@ register const char *let,*word;
                }
                if(ilet == '-') {
                    if (!allownone) {
+                       char *suf = NULL;
                        strcpy(buf, word);
+                       if ((bp = strstr(buf, " on the ")) != NULL) { /* rub on the stone[s] */
+                           *bp = '\0';
+                           suf = (bp + 1);
+                       }
                        if ((bp = strstr(buf, " or ")) != NULL) {
                            *bp = '\0';
                            bp = (rn2(2) ? buf : (bp + 4));
                        } else bp = buf;
-                       You("mime %s something.", ing_suffix(bp));
+                       You("mime %s something%s%s.", ing_suffix(bp),
+                           suf ? " " : "", suf ? suf : "");
                    }
                    return(allownone ? &zeroobj : (struct obj *) 0);
                }