Add moving on the trap to the mouse menu

This commit is contained in:
Pasi Kallinen
2022-04-11 15:08:50 +03:00
parent 503b85b1cf
commit 28e416da3a

View File

@@ -4492,6 +4492,7 @@ enum menucmd {
MCMD_SEARCH,
MCMD_LOOK_TRAP,
MCMD_UNTRAP_TRAP,
MCMD_MOVE_DIR,
MCMD_RIDE,
MCMD_REMOVE_SADDLE,
MCMD_APPLY_SADDLE,
@@ -4665,7 +4666,7 @@ there_cmd_menu_next2u(winid win, int x, int y, int mod, int *act)
if (ttmp->ttyp != VIBRATING_SQUARE)
mcmd_addmenu(win, MCMD_UNTRAP_TRAP,
"Attempt to disarm trap"), ++K;
/* TODO: "Step on the <trap>" */
mcmd_addmenu(win, MCMD_MOVE_DIR, "Move on the trap"), ++K;
}
mtmp = m_at(x, y);
@@ -4843,6 +4844,9 @@ there_cmd_menu(int x, int y, int mod)
cmdq_add_ec(dountrap);
cmdq_add_dir(dx, dy, 0);
break;
case MCMD_MOVE_DIR:
cmdq_add_ec(move_funcs[xytod(dx, dy)][MV_WALK]);
break;
case MCMD_RIDE:
cmdq_add_ec(doride);
cmdq_add_dir(dx, dy, 0);