]> granicus.if.org Git - nethack/commit
fix #H6942 - dropx vs hold_another_object
authorPatR <rankin@nethack.org>
Sun, 23 Dec 2018 20:37:26 +0000 (12:37 -0800)
committerPatR <rankin@nethack.org>
Sun, 23 Dec 2018 20:37:26 +0000 (12:37 -0800)
commit7bc36ddef41f0bf58ab5440c8d5e4c3892614e2c
tree4b055ef97b1170af6463e2177294353246f8454e
parentdf5dc6050d09652e201bfadbb92f80053ab6b76a
fix #H6942 - dropx vs hold_another_object

Dropping an existing fragile item while levitating will usually
break it.  Getting a new wished-for fragile item and dropping it
because of fumbling or overfull inventory never would.

Some callers of hold_another_object() held on to its return value,
others discarded that.  That return value was unsafe if the item
was dropped and fell down a hole (or broke [after this change]).
Return Null if we can't be sure of the value, and make sure all
callers are prepared to deal with Null.
doc/fixes36.2
include/extern.h
src/artifact.c
src/do.c
src/dothrow.c
src/invent.c
src/mail.c
src/mkobj.c
src/pickup.c
src/potion.c
src/uhitm.c