Typo fix.
[open-adventure.git] / saveresume.c
index ea30e4d09643f53ee23b72be26014294950ecec8..100c925d400ab77c0dc2c5a354a5bfb24bac2f48 100644 (file)
@@ -127,11 +127,13 @@ int resume(void) {
 
        while (fp == NULL) {
                char *name = myreadline("\nFile name: ");
-               if (name == NULL)
+               if (name == NULL) {
                        return GO_TOP;
+               }
                name = strip(name);
-               if (strlen(name) == 0)
+               if (strlen(name) == 0) {
                        return GO_TOP; // LCOV_EXCL_LINE
+               }
                fp = fopen(name, READ_MODE);
                if (fp == NULL) {
                        printf("Can't open file %s, try again.\n", name);
@@ -182,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 */