From f75deae0bcca5bdd4afddb40291e5e2bb0ecd846 Mon Sep 17 00:00:00 2001 From: Bart House Date: Thu, 4 Jul 2019 18:06:56 -0700 Subject: [PATCH] When fuzzing, use the number of moves as a proxy for the hour. Every 1000 moves simulates one hour. --- src/hacklib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hacklib.c b/src/hacklib.c index 7cf5a47c6..b97a78a65 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -1129,7 +1129,8 @@ friday_13th() int night() { - register int hour = getlt()->tm_hour; + register int hour = (iflags.debug_fuzzer ? (moves / 1000) % 24 : + getlt()->tm_hour); return (hour < 6 || hour > 21); } @@ -1137,7 +1138,10 @@ night() int midnight() { - return (getlt()->tm_hour == 0); + register int hour = (iflags.debug_fuzzer ? (moves / 1000) % 24 : + getlt()->tm_hour); + + return (hour == 0); } /* strbuf_init() initializes strbuf state for use */ -- 2.40.0