fix #K3917 - fuzzer stuck in endless lifesave loop

Life-saving from being burned up in lava attempts to teleport the
hero to safely.  If that fails, hero immediately burns up again.
For fuzz testing, that results in an infinite loop.

While implementing a fix (in done(), not just lava-specific), I
noticed that hangup while running interactively in explore or
wizard mode could be subject to similar effect.

For the fuzzer, if hero dies 15 times without advancing the move
count (not 'moves', the turn count), don't life-save again.  With
hangup, don't prompt for "Die?" more than once.

Normal interactive declining to die still works.  The more exotic
situations aren't tested.
This commit is contained in:
PatR
2023-05-06 16:51:59 -07:00
parent 5023e4bfad
commit ca02bc4898
4 changed files with 39 additions and 2 deletions

View File

@@ -307,6 +307,9 @@ struct instance_globals_d {
/* dog.c */
char dogname[PL_PSIZ];
/* end.c */
long done_seq; /* for counting deaths occurring on same hero_seq */
/* mon.c */
boolean disintegested;