munstone fixes (trunk only)

From a bug report, a monster who eats a lizard
corpse in order to cure confusion was treated the same as one who did so
to cure petrification, losing intrinsic speed in the process.  In the same
report by <l>, monsters wouldn't eat lizard corpses to cure being stunned,
and those who ate them for another reason weren't cured of stunning, even
though the hero gets that benefit.  While fixing those, I added some code
to let monsters who are carrying tins of lizard or acidic monster use them
if they're also carrying a tin opener, dagger, or knife.  I don't think
any monsters except for nymphs are willing to pick up tins, so it won't
have much effect.  It now works for nymphs though.

     Examining the code while testing showed that mon_consume_unstone()
has been accessing the potion (acid) or corpse (lizard or acidic monster)
after the item had been used up, so that has been fixed too.  I never saw
any detectable problems due to this, but folks using a debugging malloc
implementation which overwrites freed memory may have not been suffering
collateral acid damage or receiving intended confusion cure, or perhaps
did get either or both of those effects when they shouldn't have.  Since
it only applied to monsters it wouldn't have been easy to observe.
This commit is contained in:
nethack.rankin
2006-04-13 07:10:48 +00:00
parent cc31b25634
commit a157ceae1b
2 changed files with 86 additions and 29 deletions

View File

@@ -136,6 +136,10 @@ preform autopickup and/or report on objects at the spot when a failed #untrap
attempt causes the hero to move onto a trap's location
thrown silver weapon hitting silver-hating poly'd hero got double silver damage
wielded silver weapon hitting silver-hating poly'd hero lacked silver message
monsters who ate lizard corpses to cure confusion would lose intrinsic speed
monsters couldn't eat lizard corpses to cure being stunned
code handling a monster's use of potion or food to cure stoning or confusion
was accessing freed memory after the object had been used up
Platform- and/or Interface-Specific Fixes
@@ -198,6 +202,7 @@ new effect for reading a scroll of light while confused
allow digging an adjacent pit with wand of digging while trapped in a pit
#terrain command for debug mode
digging can activate or disarm some types of traps
some monsters can eat tins in addition to corpses to cure some ailments
Platform- and/or Interface-Specific New Features