]> granicus.if.org Git - nethack/commit
fix #H2428 - cockatrice nests filled with giant ant statues (trunk only)
authornethack.rankin <nethack.rankin>
Wed, 24 Aug 2011 08:17:33 +0000 (08:17 +0000)
committernethack.rankin <nethack.rankin>
Wed, 24 Aug 2011 08:17:33 +0000 (08:17 +0000)
commit4aaf41de1056058651038092d823859b45b0748e
tree6e58bfe1dc22df1d3729da08c62312b9ecf39cbb
parentcebd694c0c6f5a46354fd51f3323f1d3efc936e7
fix #H2428 - cockatrice nests filled with giant ant statues (trunk only)

     From a bug report, if the high scores file
is brand new (empty), statues placed in a cockatrice nest (special room)
end up all being giant ant statues.  Statue creation for that room
suppresses object initialization (to prevent the statues from containing
spellbooks), so statue type is left as 0 by mkobj(), then when 'record'
is empty it never gets overridden with a role value as intended.

     This forces obj->corpsenm to be initialized as NON_PM instead of 0
by default, then overrides that for corpses, statues, and figurines even
when mkobj()'s caller requests that initialization be suppressed.  So if
'record' is empty, there will be a sensible fallback statue type.

     obj->corpsenm is overloaded for leashes ('leashmon', mon->m_id),
potions ('fromsink', fountain quaff hack), spellbooks ('spestudied', the
number of times the book has been read), and loadstones (corpsenm hack to
handle singular vs plural for "you can't let go of that/those" message).
If there are any other hidden corpsenm overloads, they may behave
strangely now that corpsenm is defaulting to -1 instead of 0....
doc/fixes35.0
src/mkobj.c