R926 - polymorphed player does not explode at thin air

Reported that player polymorphed into an exploding monster does not explode
when attacking thin air.  Also noticed that if player is Unchanging, they
wouldn't die after exploding in the existing code.  Set u.mh = -1 to ensure
they won't still be around after exploding.
This commit is contained in:
cohrs
2002-07-04 06:36:37 +00:00
parent 7dd72e4ac2
commit 8a44a437e5
3 changed files with 14 additions and 3 deletions

View File

@@ -1041,13 +1041,20 @@ domove()
if (flags.forcefight ||
/* remembered an 'I' && didn't use a move command */
(glyph_is_invisible(levl[x][y].glyph) && !flags.nopick)) {
boolean expl = (Upolyd && attacktype(youmonst.data, AT_EXPL));
char buf[BUFSZ];
Sprintf(buf,"a vacant spot on the %s", surface(x,y));
You("attack %s.",
!Underwater ? "thin air" : is_pool(x,y) ? "empty water" : buf);
You("%s %s.",
expl ? "explode at" : "attack",
!Underwater ? "thin air" :
is_pool(x,y) ? "empty water" : buf);
unmap_object(x, y); /* known empty -- remove 'I' if present */
newsym(x, y);
nomul(0);
if (expl) {
u.mh = -1; /* dead in the current form */
rehumanize();
}
return;
}
if (glyph_is_invisible(levl[x][y].glyph)) {