]> granicus.if.org Git - nethack/commitdiff
Adjust couple therecmdmenu entries
authorPasi Kallinen <paxed@alt.org>
Thu, 25 Aug 2022 15:10:47 +0000 (18:10 +0300)
committerPasi Kallinen <paxed@alt.org>
Thu, 25 Aug 2022 15:10:50 +0000 (18:10 +0300)
- Don't show attacking a peaceful or tame monster, as
  that is actually swapping places with them - so add that.

- Don't show naming a hostile monster - it's usually not
  wanted, and this way when clicking a hostile monster, the
  only entry is the attack, so will be executed automatically.
  This makes it much more usable.

src/cmd.c

index b0c9f085d5fd65266edfb356fd34410516c398ca..6ed005a712df84097b4eade0ac1b34b590f024a1 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -5541,15 +5541,18 @@ there_cmd_menu_next2u(
     if (mtmp && (mtmp->mpeaceful || mtmp->mtame)) {
         Sprintf(buf, "Talk to %s", mon_nam(mtmp));
         mcmd_addmenu(win, MCMD_TALK, buf), ++K;
-    }
-    if (mtmp) {
+
+        Sprintf(buf, "Swap places with %s", mon_nam(mtmp));
+        mcmd_addmenu(win, MCMD_MOVE_DIR, buf), ++K;
+
         Sprintf(buf, "%s %s",
                 !has_mgivenname(mtmp) ? "Name" : "Rename",
                 mon_nam(mtmp));
         mcmd_addmenu(win, MCMD_NAME, buf), ++K;
     }
 
-    if (mtmp || glyph_is_invisible(glyph_at(x, y))) {
+    if ((mtmp && !(mtmp->mpeaceful || mtmp->mtame))
+        || glyph_is_invisible(glyph_at(x, y))) {
         Sprintf(buf, "Attack %s", mtmp ? mon_nam(mtmp) : "unseen creature");
         mcmd_addmenu(win, MCMD_ATTACK_NEXT2U, buf), ++K;
         /* attacking overrides any other automatic action */