eating, drinking via #herecmdmenu

Fix eat floor food and drink from dungeon feature via #herecmdmenu.
That uses queued commands, but those two actions were changed to
skip the floor when queued input was present because asking about
floor items interfered with context-sensitive inventory item-actions.

I was misled by a comment that says it couldn't insert an m-prefix;
that was for treating the 'm' key as typed text rather than as a
command.  There's no problem with inserting a #reqmenu command which
is what 'm' is these days.  So item actions can force 'm' to skip the
floor and go directly to inventory, also the #eat and #quaff commands
don't have to alter their behavior when queued input is pending so
the #herecmdmenu usage for them gets fixed.
This commit is contained in:
PatR
2022-04-16 15:32:41 -07:00
parent f04f974c11
commit 52cfe40d33
3 changed files with 15 additions and 11 deletions

View File

@@ -531,11 +531,9 @@ dodrink(void)
drink_ok_extra = 0;
/* preceding 'q'/#quaff with 'm' skips the possibility of drinking
from fountains, sinks, and surrounding water plus the prompting
which those entail; if cmdq is non-empty, player has selected a
potion from inventory and then chosen action-item 'quaff' so
skip fountains,&c for that case too--the potion's inv letter is
queued up for next getobj() */
if (!iflags.menu_requested && !cmdq_peek()) {
which those entail; optional for interactive use, essential for
context-sensitive inventory item action 'quaff' */
if (!iflags.menu_requested) {
/* Is there a fountain to drink from here? */
if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)
/* not as low as floor level but similar restrictions apply */