prior revision broke all prefix usage
movement command revamp broke 'm>' and 'm<' on stairs to avoid auto-pickup at
the destination
+when trapeffect_selector() returns 2 to caller mintrap(), meant to
+ signify that the monster was killed in the trap, ensure that
+ mintrap() returns that value too
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support
mintrap(register struct monst *mtmp)
{
register struct trap *trap = t_at(mtmp->mx, mtmp->my);
- boolean trapkilled = FALSE;
struct permonst *mptr = mtmp->data;
+ int trap_result = 0;
if (!trap) {
mtmp->mtrapped = 0; /* perhaps teleported? */
if (trap->madeby_u && rnl(5))
setmangry(mtmp, FALSE);
- return trapeffect_selector(mtmp, trap, 0);
+ trap_result = trapeffect_selector(mtmp, trap, 0);
}
- if (trapkilled)
- return 2;
- return mtmp->mtrapped;
+ return (trap_result == 2) ? trap_result : mtmp->mtrapped;
}
/* Combine cockatrice checks into single functions to avoid repeating code. */