From 5b917084b035b815cc7b8282219ae7266f239d68 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 4 Feb 2024 11:43:36 -0500 Subject: [PATCH] Minor repair of savefile validation code. --- saveresume.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/saveresume.c b/saveresume.c index 9822b76..100c925 100644 --- a/saveresume.c +++ b/saveresume.c @@ -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 */ -- 2.31.1