From: PatR Date: Fri, 15 Apr 2022 19:09:17 +0000 (-0700) Subject: context-sensitive inventory item-action quaff X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4485515872fa0079de9d5f43d554d31bf2271aab;p=nethack 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. --- 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 */