fix temporary strength loss that was permanent

Watching the fuzzer, I saw hero's strength plummet to 3 again and not
rise above 5 after that.  It turns out to be due to life-saving, which
was fixing severe hunger but was not restoring the point of strength
that's lost when you go from hungry to weak.

I'm not sure whether this was caused by 3.6.1's commit
024e9e1225 or already behaved that way.

Another fuzzer bit:  the monk I was watching was bitten by a wererat
early on and was still inflicted with lycanthropy when he reached
level 19.  (I've no idea how his level got to be so high; it jumped
from 14 to 19 while I wasn't paying attention.)  Extend the earlier
hack for drinking a blessed potion of restore ability to recover lost
characteristcs to sometimes drink a potion of holy water instead.
This commit is contained in:
PatR
2018-12-24 02:08:44 -08:00
parent f6d5862c0d
commit e2852f25fd
2 changed files with 10 additions and 8 deletions

View File

@@ -301,6 +301,8 @@ message sequencing when vampire shifts to fog cloud to pass under closed door:
when in sight, give form change message before moving to door spot
limit carrying heavy loads from water to land
failing to carry a wished-for item behaved differenctly from dropping one
life-saving while weak/starving/fainting boosted nutrition without restoring
lost point of strength, making temporary loss be permanent
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 end.c $NHDT-Date: 1545172226 2018/12/18 22:30:26 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.159 $ */
/* NetHack 3.6 end.c $NHDT-Date: 1545646111 2018/12/24 10:08:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.160 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -859,16 +859,13 @@ int how;
u.uhp = u.uhpmax;
if (Upolyd) /* Unchanging, or death which bypasses losing hit points */
u.mh = u.mhmax;
if (u.uhunger < 500) {
u.uhunger = 500;
newuhs(FALSE);
if (u.uhunger < 500 || how == CHOKING) {
init_uhunger();
}
/* cure impending doom of sickness hero won't have time to fix */
if ((Sick & TIMEOUT) == 1L) {
make_sick(0L, (char *) 0, FALSE, SICK_ALL);
}
if (how == CHOKING)
init_uhunger();
nomovemsg = "You survived that attempt on your life.";
context.move = 0;
if (multi > 0)
@@ -1060,9 +1057,12 @@ int how;
if (iflags.debug_fuzzer) {
if (!(program_state.panicking || how == PANICKED)) {
savelife(how);
/* periodically restore characteristics and lost exp levels */
/* periodically restore characteristics and lost exp levels
or cure lycanthropy */
if (!rn2(10)) {
struct obj *potion = mksobj(POT_RESTORE_ABILITY, TRUE, FALSE);
struct obj *potion = mksobj((u.ulycn > LOW_PM && !rn2(3))
? POT_WATER : POT_RESTORE_ABILITY,
TRUE, FALSE);
bless(potion);
(void) peffects(potion); /* always -1 for restore ability */