From 8a44a437e579e3f0683bd586d56113ba8fed1d3d Mon Sep 17 00:00:00 2001 From: cohrs Date: Thu, 4 Jul 2002 06:36:37 +0000 Subject: [PATCH] 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. --- doc/fixes34.1 | 2 ++ src/hack.c | 11 +++++++++-- src/uhitm.c | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 147e4ceb3..117d607e9 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -137,6 +137,8 @@ grammar of blessed-detection eating warning messages when eating 1 of N objects message for charging for items lost in a cursed magic bag wasn't always shown dropping gold on an altar printed no message and didn't change gnostic conduct don't allow cursed daggers thrown by monsters to go thru closed doors +hero polymorphed into an exploding monster should explode when attacking + thin air, just like the monster itself Platform- and/or Interface-Specific Fixes diff --git a/src/hack.c b/src/hack.c index 7c10fa500..bffcbdad0 100644 --- a/src/hack.c +++ b/src/hack.c @@ -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)) { diff --git a/src/uhitm.c b/src/uhitm.c index 025805ac4..e978e780e 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1920,8 +1920,10 @@ use_weapon: impossible("strange attack of yours (%d)", mattk->aatyp); } - if (dhit == -1) + if (dhit == -1) { + u.mh = -1; /* dead in the current form */ rehumanize(); + } if (sum[i] == 2) return((boolean)passive(mon, 1, 0, mattk->aatyp)); /* defender dead */