From 4485515872fa0079de9d5f43d554d31bf2271aab Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 15 Apr 2022 12:09:17 -0700 Subject: [PATCH] context-sensitive inventory item-action quaff Picking a potion from inventory and then picking 'quaff this potion' from the context menu needed handling similar to eat/offer/tin: skip floor candidates. If you were on a fountain or sink, picked a potion from inventory and then the quaff option for it, you weren't prompted to drink from the fountain but you were prompted for what potion to drink instead of using the one that had already been picked to initiate drinkig. --- src/potion.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/potion.c b/src/potion.c index 5a1e0d286..27ee71151 100644 --- a/src/potion.c +++ b/src/potion.c @@ -531,8 +531,11 @@ 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 (!iflags.menu_requested) { + 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()) { /* 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 */