Files
nethack/src
Michael Meyer 47076c3625 Fix: duplicate invlet from throwing obj with count
Specifying a count of 1 when throwing an object could leave you with two
stacks sharing one inventory letter.  The second stack gets split off
when the player specifies a count (e.g. 't1o'), but keeps its original
invlet.  Some early returns, like trying to throw at yourself with '.',
could fail to unsplit the stack.  Theoretically, specifying multiple
items to multishot and then failing to throw them all could also leave a
partial stack; I don't think this is actually possible right now with
't' but I tried to make sure it won't become a problem if greater counts
than 1 are ever allowed.

The fix doesn't affect 'f', which can be a combined "create a quiver
stack and throw" action and doesn't have the issue with duping invlets.
Specifying a count to split off a new quiver stack with 'f' shouldn't be
reverted if the throwing fails or only part of the stack is thrown,
because the newly created stack may be intended for continued use as the
quiver in future turns.  This slightly changes the behavior of the
existing unsplit when cancelling the throw (which previously unsplit the
newly created quiver and quivered the entire parent stack), but I think
this actually makes more sense -- the player only declined to throw the
new stack, not to create it (as if they canceled earlier in the action).

I routed a couple early returns through the stack unsplitting that
shouldn't actually need it (like Mjollnir and welded items) for
consistency's sake; I don't think it hurts anything.
2022-10-23 00:01:54 -07:00
..
2022-02-04 09:41:30 -05:00
2022-08-11 17:07:43 +03:00
2022-09-24 04:39:12 -07:00
2022-10-20 10:33:38 -07:00
2022-10-12 02:19:38 -07:00
2022-06-30 23:48:18 -04:00
2022-07-18 13:27:39 +03:00
2022-09-10 19:30:36 -07:00
2022-10-20 10:33:38 -07:00
2022-07-02 09:10:03 -04:00
2022-03-17 18:10:38 -04:00
2022-10-20 10:39:11 -07:00
2022-10-21 14:31:33 -07:00
2022-09-11 21:52:46 +03:00
2022-09-30 08:59:57 -04:00
2022-06-30 23:48:18 -04:00
2022-09-25 01:21:07 -07:00
2022-09-13 10:52:15 -07:00
2022-10-13 13:19:58 -07:00
2022-09-19 17:32:42 -04:00
2022-10-11 14:49:14 -07:00
2022-10-07 11:15:10 -04:00
2022-10-08 15:56:12 -07:00
2022-09-28 14:11:05 -07:00
2022-05-07 10:25:13 -04:00
2022-08-31 13:04:54 -07:00
2022-09-08 10:54:11 -04:00
2022-07-19 15:14:55 +03:00
2022-08-14 10:12:54 +03:00
2022-10-13 14:03:52 -07:00
2022-08-18 14:38:45 -07:00
2022-08-09 11:54:45 +03:00
2022-09-06 22:58:28 +03:00
2022-08-21 11:36:39 +03:00
2022-08-09 11:54:45 +03:00
2022-06-12 13:19:13 -07:00
2022-10-08 15:56:12 -07:00
2022-08-26 12:43:40 +03:00
2022-09-08 10:54:11 -04:00
2022-01-29 11:13:01 -08:00
2022-10-12 02:05:32 -07:00
2022-09-08 10:54:11 -04:00
2022-09-22 11:36:47 +03:00
2022-04-29 12:44:26 -07:00
2022-09-28 13:42:18 -07:00
2022-08-21 11:36:39 +03:00
2022-08-12 19:37:34 +03:00
2022-10-12 13:47:12 -07:00
2022-09-08 10:54:11 -04:00
2022-10-03 15:53:35 -07:00
2022-10-02 20:41:02 -04:00
2022-02-09 22:49:25 +02:00
2021-01-26 21:06:16 -05:00
2022-09-22 23:16:19 -07:00
2022-10-02 20:41:02 -04:00
2022-07-15 13:48:29 -07:00
2022-07-29 16:11:35 -07:00
2022-03-18 10:19:04 +02:00
2022-09-05 11:16:43 -04:00
2022-09-16 16:38:44 -07:00
2022-07-17 21:37:31 +03:00
2022-10-02 12:42:12 -07:00