fix github issue #159 - eating nurse corpses
Fixes #159 The nurse monster definition is flagged to be able to convery poison resistance when a corpse or tin is eaten, but the post-corpse code for nurse healed HP and cured blindness then skipped the intrinsic handling.
This commit is contained in:
@@ -196,6 +196,7 @@ avoid potential buffer overflow if object with very long name knocks other
|
||||
#wizintrinsic for 'warn_of_mon' didn't set any type of monster (now grid bugs)
|
||||
clairvoyance would show trap instead of a monster on/in that trap, which was
|
||||
intentional, but when clairvoyance finished the monster wasn't shown
|
||||
nurse corpse/tin chance to convey poison resistance when eaten was not honored
|
||||
|
||||
|
||||
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
||||
|
||||
19
src/eat.c
19
src/eat.c
@@ -943,10 +943,11 @@ register struct permonst *ptr;
|
||||
/* called after completely consuming a corpse */
|
||||
STATIC_OVL void
|
||||
cpostfx(pm)
|
||||
register int pm;
|
||||
int pm;
|
||||
{
|
||||
register int tmp = 0;
|
||||
int tmp = 0;
|
||||
int catch_lycanthropy = NON_PM;
|
||||
boolean check_intrinsics = FALSE;
|
||||
|
||||
/* in case `afternmv' didn't get called for previously mimicking
|
||||
gold, clean up now to avoid `eatmbuf' memory leak */
|
||||
@@ -958,6 +959,7 @@ register int pm;
|
||||
/* MRKR: "eye of newt" may give small magical energy boost */
|
||||
if (rn2(3) || 3 * u.uen <= 2 * u.uenmax) {
|
||||
int old_uen = u.uen;
|
||||
|
||||
u.uen += rnd(3);
|
||||
if (u.uen > u.uenmax) {
|
||||
if (!rn2(3))
|
||||
@@ -989,6 +991,7 @@ register int pm;
|
||||
u.uhp = u.uhpmax;
|
||||
make_blinded(0L, !u.ucreamed);
|
||||
context.botl = 1;
|
||||
check_intrinsics = TRUE; /* might also convey poison resistance */
|
||||
break;
|
||||
case PM_STALKER:
|
||||
if (!Invis) {
|
||||
@@ -1090,7 +1093,13 @@ register int pm;
|
||||
pline("For some reason, that tasted bland.");
|
||||
}
|
||||
/*FALLTHRU*/
|
||||
default: {
|
||||
default:
|
||||
check_intrinsics = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* possibly convey an intrinsic */
|
||||
if (check_intrinsics) {
|
||||
struct permonst *ptr = &mons[pm];
|
||||
boolean conveys_STR = is_giant(ptr);
|
||||
int i, count;
|
||||
@@ -1137,9 +1146,7 @@ register int pm;
|
||||
gainstr((struct obj *) 0, 0, TRUE);
|
||||
else if (tmp > 0)
|
||||
givit(tmp, ptr);
|
||||
break;
|
||||
} /* default case */
|
||||
} /* switch */
|
||||
} /* check_intrinsics */
|
||||
|
||||
if (catch_lycanthropy >= LOW_PM) {
|
||||
set_ulycn(catch_lycanthropy);
|
||||
|
||||
Reference in New Issue
Block a user