X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=saveresume.c;h=ab2e1fed3ad67e57457f5e44acc16cd474113d9f;hp=8fe93091697023b60db2c3a422fad66e7620e961;hb=2ad0fc148bb0e509b8ef86a8746679503e395a91;hpb=79875c80887f2484d6652a24dfc67167290680cc diff --git a/saveresume.c b/saveresume.c index 8fe9309..ab2e1fe 100644 --- a/saveresume.c +++ b/saveresume.c @@ -18,12 +18,12 @@ #include "advent.h" #include "dungeon.h" -#define VRSION 28 /* bump on save format change */ +#define VRSION 29 /* bump on save format change */ /* * If you change the first three members, the resume function may not properly * reject saves from older versions. Yes, this glues us to a hardware- - * dependent length of long. Later members can change, but bump the version + * dependent length of int. Later members can change, but bump the version * when you do that. */ struct save_t { @@ -146,7 +146,7 @@ bool is_valid(struct game_t valgame) /* Check for RNG overflow. Truncate */ if (valgame.lcg_x >= LCG_M) { - valgame.lcg_x %= LCG_M; + valgame.lcg_x %= LCG_M; // LCOV_EXCL_LINE } /* Check for RNG underflow. Transpose */ @@ -186,11 +186,11 @@ bool is_valid(struct game_t valgame) /* Validate that we didn't die too many times in save */ if (valgame.numdie >= NDEATHS) { - return false; + return false; // LCOV_EXCL_LINE } /* Recalculate tally, throw the towel if in disagreement */ - long temp_tally = 0; + int temp_tally = 0; for (int treasure = 1; treasure <= NOBJECTS; treasure++) { if (objects[treasure].is_treasure) { if (valgame.prop[treasure] == STATE_NOTFOUND) {