Fuzzer randomly teleports between dungeon branches

Previously the fuzzer usually stayed in the Dungeons of Doom,
only very rarely going to other dungeon branches. Now, it will
randomly choose a dungeon branch and a level in that branch
to level teleport to.
This commit is contained in:
Pasi Kallinen
2023-03-17 14:14:06 +02:00
parent da0a681688
commit f2b75c3b0e

View File

@@ -859,8 +859,16 @@ level_tele(void)
char buf[BUFSZ];
boolean force_dest = FALSE;
if (iflags.debug_fuzzer)
goto random_levtport;
if (iflags.debug_fuzzer) {
do {
newlevel.dnum = rn2(gn.n_dgns);
} while (newlevel.dnum == astral_level.dnum
|| gd.dungeons[newlevel.dnum].flags.unconnected
|| !gd.dungeons[newlevel.dnum].num_dunlevs);
newlevel.dlevel = 1 + rn2(dunlevs_in_dungeon(&newlevel));
schedule_goto(&newlevel, UTOTYPE_NONE, (char *) 0, (char *) 0);
return;
}
if ((u.uhave.amulet || In_endgame(&u.uz) || In_sokoban(&u.uz))
&& !wizard) {
You_feel("very disoriented for a moment.");