From: PatR Date: Thu, 13 Dec 2018 01:55:43 +0000 (-0800) Subject: fuzzing hero boost X-Git-Tag: nmake-explicit-path~45^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a63b9f29a5f8beace02ae4bc69b924a8c9758fe4;p=nethack fuzzing hero boost I watched the fuzzer run for a bit and noticed that Str and most other characteristics were steadily dropping until they hit 3 and not being recovered, so I gave the defenseless hero a chance to benefit from blessed restore ability occasionally. It hasn't helped much. Str and Con both still drop to 3. [If I had to guess, I'd go with side-effect of polymorphing, but not an intended one.] --- diff --git a/src/end.c b/src/end.c index cbc312598..e90745cdb 100644 --- a/src/end.c +++ b/src/end.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 end.c $NHDT-Date: 1544003110 2018/12/05 09:45:10 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.156 $ */ +/* NetHack 3.6 end.c $NHDT-Date: 1544666123 2018/12/13 01:55:23 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.157 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -577,13 +577,13 @@ VA_DECL(const char *, str) ? "Program initialization has failed." : "Suddenly, the dungeon collapses."); #ifndef MICRO -#if defined(NOTIFY_NETHACK_BUGS) +#ifdef NOTIFY_NETHACK_BUGS if (!wizard) raw_printf("Report the following error to \"%s\" or at \"%s\".", DEVTEAM_EMAIL, DEVTEAM_URL); else if (program_state.something_worth_saving) raw_print("\nError save file being written.\n"); -#else +#else /* !NOTIFY_NETHACK_BUGS */ if (!wizard) { const char *maybe_rebuild = !program_state.something_worth_saving ? "." @@ -599,7 +599,7 @@ VA_DECL(const char *, str) raw_printf("Report error to \"%s\"%s", WIZARD_NAME, maybe_rebuild); } -#endif +#endif /* ?NOTIFY_NETHACK_BUGS */ /* XXX can we move this above the prints? Then we'd be able to * suppress "it may be possible to rebuild" based on dosave0() * or say it's NOT possible to rebuild. */ @@ -611,7 +611,7 @@ VA_DECL(const char *, str) raw_printf("%s", sysopt.recover); } } -#endif +#endif /* !MICRO */ { char buf[BUFSZ]; @@ -1055,7 +1055,16 @@ int how; if (iflags.debug_fuzzer) { if (!(program_state.panicking || how == PANICKED)) { savelife(how); - killer.name[0] = 0; + /* periodically restore characteristics and lost exp levels */ + if (!rn2(10)) { + struct obj *potion = mksobj(POT_RESTORE_ABILITY, TRUE, FALSE); + + bless(potion); + (void) peffects(potion); /* always -1 for restore ability */ + /* not useup(); we haven't put this potion into inventory */ + obfree(potion, (struct obj *) 0); + } + killer.name[0] = '\0'; killer.format = 0; return; }