From: Bart House Date: Fri, 5 Jul 2019 01:06:56 +0000 (-0700) Subject: When fuzzing, use the number of moves as a proxy for the hour. X-Git-Tag: v3.6.3.757eca7~168 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f75deae0bcca5bdd4afddb40291e5e2bb0ecd846;p=nethack When fuzzing, use the number of moves as a proxy for the hour. Every 1000 moves simulates one hour. --- 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 */