Minor repair of savefile validation code.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 4 Feb 2024 16:43:36 +0000 (11:43 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 4 Feb 2024 16:43:36 +0000 (11:43 -0500)
saveresume.c

index 9822b76409541dd1b4c2e286c7bd27feccbbeae2..100c925d400ab77c0dc2c5a354a5bfb24bac2f48 100644 (file)
@@ -184,12 +184,7 @@ bool is_valid(struct game_t valgame) {
 
        /* Check for RNG overflow. Truncate */
        if (valgame.lcg_x >= LCG_M) {
-               valgame.lcg_x %= LCG_M; // LCOV_EXCL_LINE
-       }
-
-       /* Check for RNG underflow. Transpose */
-       if (valgame.lcg_x < LCG_M) {
-               valgame.lcg_x = LCG_M + (valgame.lcg_x % LCG_M);
+               return false;
        }
 
        /*  Bounds check for locations */