]> granicus.if.org Git - nethack/commit
fix "display_minventory: static object freed" panic (duplicate monster gold)
authornethack.rankin <nethack.rankin>
Thu, 21 Apr 2005 05:15:04 +0000 (05:15 +0000)
committernethack.rankin <nethack.rankin>
Thu, 21 Apr 2005 05:15:04 +0000 (05:15 +0000)
commit0f13d56446a43c8af90e3422f6c0cddc509435fb
treee31b209036ffb8945c0505e421b06d235937e79d
parentf4a3b20afe9e37b8093d45f4cef21bd111d3568e
fix "display_minventory: static object freed" panic (duplicate monster gold)

     From a bug report, using stone to flesh to
reanimate a petrified monster who was carrying gold (in his case, it was
a shopkeeper) resulted in gold in the monster's inventory.  Somehow it was
also being duplicated in the mgold field--I didn't try to figure that part
out--so killing the monster produced double gold.  More significantly,
probing such a monster prior to killing it caused a panic when the monster
inventory was being massaged for formatting.

     Fix is trivial:  use a routine which knows about special handling for
gold when transferring statue contents to resurrected monster.  Both aspects
of the problem only occurred for the !GOLDOBJ configuration (which is our
default).  However, any objects which confer something special when simply
being carried would have also been misbehaving--automagic animation of
cursed figurines is the only applicable situation; too rare for anyone to
have noticed.
doc/fixes34.4
src/trap.c