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

@@ -3437,9 +3437,8 @@ floorfood(
* floor food has been declined and inventory lacks
* any suitable items */
/* if we can't touch floor objects then use invent food only;
same if 'm' prefix was used or we're executing an item action
for context-sensitive inventory */
if (iflags.menu_requested || cmdq_peek()
same when 'm' prefix is used--for #eat, it means "skip floor food" */
if (iflags.menu_requested
|| !can_reach_floor(TRUE) || (feeding && u.usteed)
|| (is_pool_or_lava(u.ux, u.uy)
&& (Wwalking || is_clinger(uptr) || (Flying && !Breathless))))