loadstone dropping fix

Fix the reported problem of bad inventory management if the user
specified a count (with traditional menu style) when attempting to drop
part of a stack of cursed loadstones.  After the "you can't drop that"
message, it tried to undo the stack split, but splitobj was changed
sometime back and the undo hack wasn't adjusted to account for the fact
that it needed to merge with the previous object instead of the next one.
The result was that it would incorrectly increment the count of the next
item instead of the original loadstone, or crash in canletgo() if the
split off stone was the last item in the list.

     This prevents cursed loadstones from being split (via getobj()'s
count handling) in the first place, so there's nothing to undo later.
It still uses a similar kludge so that the "can't drop that" message can
be adjusted, but it's now a simpler kludge and I hope a more robust one.
This commit is contained in:
nethack.rankin
2003-12-03 07:10:24 +00:00
parent b7a2c26248
commit 3df53e952c
3 changed files with 33 additions and 29 deletions

View File

@@ -97,6 +97,8 @@ must be able to reach floor in order to use stethoscope on corpse or statue
fix a few coordinate (y,y) -> (x,y) typos in apply.c, mon.c, and wizard.c
killing a long worm on a drawbridge could produce a panic
prevent "see it drop from your pack" when figurine monster becomes undetected
attempting to drop a subset of a stack of multiple cursed loadstones could
corrupt inventory or cause a crash
Platform- and/or Interface-Specific Fixes