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:
PatR
2018-11-13 15:05:54 -08:00
parent 8e907a0b0f
commit a97d0b7270
2 changed files with 14 additions and 6 deletions
+1
View File
@@ -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) #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 clairvoyance would show trap instead of a monster on/in that trap, which was
intentional, but when clairvoyance finished the monster wasn't shown 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 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
+13 -6
View File
@@ -943,10 +943,11 @@ register struct permonst *ptr;
/* called after completely consuming a corpse */ /* called after completely consuming a corpse */
STATIC_OVL void STATIC_OVL void
cpostfx(pm) cpostfx(pm)
register int pm; int pm;
{ {
register int tmp = 0; int tmp = 0;
int catch_lycanthropy = NON_PM; int catch_lycanthropy = NON_PM;
boolean check_intrinsics = FALSE;
/* in case `afternmv' didn't get called for previously mimicking /* in case `afternmv' didn't get called for previously mimicking
gold, clean up now to avoid `eatmbuf' memory leak */ 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 */ /* MRKR: "eye of newt" may give small magical energy boost */
if (rn2(3) || 3 * u.uen <= 2 * u.uenmax) { if (rn2(3) || 3 * u.uen <= 2 * u.uenmax) {
int old_uen = u.uen; int old_uen = u.uen;
u.uen += rnd(3); u.uen += rnd(3);
if (u.uen > u.uenmax) { if (u.uen > u.uenmax) {
if (!rn2(3)) if (!rn2(3))
@@ -989,6 +991,7 @@ register int pm;
u.uhp = u.uhpmax; u.uhp = u.uhpmax;
make_blinded(0L, !u.ucreamed); make_blinded(0L, !u.ucreamed);
context.botl = 1; context.botl = 1;
check_intrinsics = TRUE; /* might also convey poison resistance */
break; break;
case PM_STALKER: case PM_STALKER:
if (!Invis) { if (!Invis) {
@@ -1090,7 +1093,13 @@ register int pm;
pline("For some reason, that tasted bland."); pline("For some reason, that tasted bland.");
} }
/*FALLTHRU*/ /*FALLTHRU*/
default: { default:
check_intrinsics = TRUE;
break;
}
/* possibly convey an intrinsic */
if (check_intrinsics) {
struct permonst *ptr = &mons[pm]; struct permonst *ptr = &mons[pm];
boolean conveys_STR = is_giant(ptr); boolean conveys_STR = is_giant(ptr);
int i, count; int i, count;
@@ -1137,9 +1146,7 @@ register int pm;
gainstr((struct obj *) 0, 0, TRUE); gainstr((struct obj *) 0, 0, TRUE);
else if (tmp > 0) else if (tmp > 0)
givit(tmp, ptr); givit(tmp, ptr);
break; } /* check_intrinsics */
} /* default case */
} /* switch */
if (catch_lycanthropy >= LOW_PM) { if (catch_lycanthropy >= LOW_PM) {
set_ulycn(catch_lycanthropy); set_ulycn(catch_lycanthropy);