R739 - dead migrating monster

- It was possible for hmon_hitmon to call mhurtle to move a monster into a
hole or other trap, causing it to migrate.  Then, hmon_hitmon would
subtract hp, and could mark the monster as dead.  Later, dmonsfree would
notice the monster wasn't on the level anymore, causing the impossible.
Avoid the problem by just not hurtling the monster if it's going to die.
It's possible it will get lifesaved after not hurtling.  Technically, if it
does die, the corpse should be hurtled, but won't be.
- treat jousting similarly
This commit is contained in:
cohrs
2002-04-01 07:03:44 +00:00
parent 31c4ccd43b
commit a0ba9d1421
2 changed files with 8 additions and 2 deletions

View File

@@ -46,6 +46,8 @@ cannot trip over submerged objects if you're water walking
wand of striking was not identified if it activated a statue trap
cannot sacrifice while you're swallowed
player polymorphed into an eel cannot drown breathless/amphibious monsters
avoid dmonsfree impossible message due to migrating a dead monster via
mhurtle causing the monster to end up in a hole or other trap
Platform- and/or Interface-Specific Fixes

View File

@@ -896,7 +896,9 @@ int thrown;
if (jousting) {
You("joust %s%s",
mon_nam(mon), canseemon(mon) ? exclam(tmp) : ".");
mhurtle(mon, u.dx, u.dy, 1);
/* avoid migrating a dead monster */
if (mon->mhp > tmp)
mhurtle(mon, u.dx, u.dy, 1);
hittxt = TRUE;
} else
#endif
@@ -908,7 +910,9 @@ int thrown;
if (canspotmon(mon))
pline("%s %s from your powerful strike!", Monnam(mon),
makeplural(stagger(mon->data, "stagger")));
mhurtle(mon, u.dx, u.dy, 1);
/* avoid migrating a dead monster */
if (mon->mhp > tmp)
mhurtle(mon, u.dx, u.dy, 1);
hittxt = TRUE;
}
}