Files
nethack/include
PatR 2674a9904d github issue #1249 - menu pay of contained items
Issue reported by ars3niy:  unpaid containers containing one or
more other unpaid items appear on the menu for 'p' along with
separate menu entries for those other items.  Buying the container
buys the contents too, then if any of the contents were also picked
in the menu, an attempt will be made to pay for them separately.
Since they are no longer on the bill by that point, that triggers
an impossible warning.

This fixes that by paying for the container but not its contents.
(Temporarily, until more extensive changes get implemented.)  Then
those contents will still be on the bill.  It they've been chosen
in the 'p' menu, paying for them will work as expected.

This also fixes the pay menu for the case where the bill contains
any instances of a partly used up portion of some stack and also
the unpaid intact portion of the same stack.  With itemized billing,
you are allowed to buy the used up portion separately, then maybe
drop the unpaid portion.  (If you try to pay for the intact portion,
the shk won't accept the payment and will tell you to pay for the
used up portion first.)  With the recently added menu for billing,
they were lumped together as a single item and you had to pay for
their whole stack.

And it fixes a much older bug dealing with the cheapest item on
the shop bill.  If you don't have enough to pay for that, the rest
of buying gets skipped.  But stacks that had used up and intact
portions were lumping those together instead of separately checking
the two portions for possibly being the cheapest, so it was possible
to have enough gold to pay for one portion but be told that you
couldn't affort to pay for anything.  If it was the intact portion,
you wouldn't be able to buy it anyway, but if the cheapest item was
used up portion, being told you didn't have enough gold was wrong.

This commit does not fix the longstanding bug that itemized billing
reveals the contents of containers which haven't been opened.  It
was intended to do so but I've run out of steam.

(There is groundwork for that, where buying a container would
include payment for its unpaid contents without revealing what those
are, and they couldn't be purchased separately unless they get taken
out of the container.  Uncommenting '#define CONTAINED_BUYING' will
enable it, with updated pay menu handling but without being able to
pay for non-empty containers.)

Fixes #1249
2024-06-27 14:13:39 -07:00
..
2022-02-04 11:01:20 -05:00
2022-03-13 13:58:56 -07:00
2022-11-29 21:53:21 -05:00
2024-02-28 11:47:16 -08:00
2023-05-22 20:50:35 -04:00
2024-03-24 10:27:42 -04:00
2022-06-30 23:48:18 -04:00
2024-02-16 14:14:05 -08:00
2023-03-01 14:00:29 +02:00
2024-04-04 23:22:28 +03:00
2021-01-26 21:06:16 -05:00
2024-03-07 11:01:04 -05:00
2023-05-04 06:02:23 -07:00
2024-05-17 14:38:17 -07:00
2024-03-07 15:50:05 -05:00
2024-06-08 13:34:12 -07:00
2024-03-07 11:01:04 -05:00
2022-03-11 07:33:28 -05:00
2022-06-19 02:30:45 -07:00
2023-12-09 12:43:41 +02:00
2024-05-08 14:17:11 -07:00
2024-02-28 20:15:56 -08:00
2024-02-24 13:49:51 -08:00
2024-06-21 12:57:31 -07:00
2024-02-28 20:15:56 -08:00
2024-02-28 20:15:56 -08:00
2023-11-22 16:01:58 -05:00
2022-10-26 14:21:23 -04:00
2022-10-26 14:21:23 -04:00
2022-10-26 14:21:23 -04:00
2024-02-28 20:15:56 -08:00
2023-10-16 09:11:05 -04:00
2024-03-07 11:01:04 -05:00
2024-02-28 20:15:56 -08:00
2023-02-25 18:05:09 +02:00
2022-11-29 21:53:21 -05:00
2024-03-07 11:01:04 -05:00
2024-04-04 06:44:23 -07:00
2023-11-22 16:01:58 -05:00
2020-08-12 16:15:28 -07:00
2024-01-28 01:13:08 -08:00
2024-06-15 19:04:57 +03:00
2024-03-23 10:11:35 -07:00
2023-11-22 16:01:58 -05:00
2022-06-30 23:48:18 -04:00
2024-04-02 14:31:33 +03:00
2024-06-09 11:17:54 -07:00
2022-10-26 14:21:23 -04:00
2022-10-26 14:21:23 -04:00
2024-04-04 23:22:28 +03:00