]> granicus.if.org Git - nethack/commit
mon->mhp manipulation
authorPatR <rankin@nethack.org>
Sun, 22 May 2016 01:25:16 +0000 (18:25 -0700)
committerPatR <rankin@nethack.org>
Sun, 22 May 2016 01:25:16 +0000 (18:25 -0700)
commitc1bfa1360fb037ad51b555d3cacaee5972de00a6
tree57924fd244a70117c16dac7fbe294827b7873770
parent29e9179ca568cd83ecef08896d3025422f7e896c
mon->mhp manipulation

I've hunted for other instances where monster hit points were set
to zero or less without calling the routine that kills off the
monster (see recent mon_unslime() vs zhitm()) and didn't find any
for mhp subtraction.  I haven't checked for direct assignment yet.

For a while I thought I'd found several cases where a monster was
intended to be killed but got left with positive hit points, but
it turned out that lifesaved_monster(), of all places, was setting
them to zero.  I've moved that to its callers so that it isn't so
well hidden.  And changed several ''if ((mon->mhp -= dmg) <= 0)''
into separate subtraction and 'if' just so the mhp manipulation is
a bit more visible.

I think the only actual change here is the message for monster
being killed by lava, where glass golems now melt instead of burn.
src/makemon.c
src/mon.c
src/muse.c
src/music.c
src/trap.c
src/uhitm.c
src/zap.c