From: Eric S. Raymond Date: Sun, 4 Feb 2024 16:43:36 +0000 (-0500) Subject: Minor repair of savefile validation code. X-Git-Tag: 1.18~10 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=5b917084b035b815cc7b8282219ae7266f239d68;p=open-adventure.git Minor repair of savefile validation code. --- 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 */