projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Typo fix.
[open-adventure.git]
/
saveresume.c
diff --git
a/saveresume.c
b/saveresume.c
index ea30e4d09643f53ee23b72be26014294950ecec8..100c925d400ab77c0dc2c5a354a5bfb24bac2f48 100644
(file)
--- a/
saveresume.c
+++ b/
saveresume.c
@@
-127,11
+127,13
@@
int resume(void) {
while (fp == NULL) {
char *name = myreadline("\nFile name: ");
while (fp == NULL) {
char *name = myreadline("\nFile name: ");
- if (name == NULL)
+ if (name == NULL)
{
return GO_TOP;
return GO_TOP;
+ }
name = strip(name);
name = strip(name);
- if (strlen(name) == 0)
+ if (strlen(name) == 0)
{
return GO_TOP; // LCOV_EXCL_LINE
return GO_TOP; // LCOV_EXCL_LINE
+ }
fp = fopen(name, READ_MODE);
if (fp == NULL) {
printf("Can't open file %s, try again.\n", name);
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) {
/* 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 */
}
/* Bounds check for locations */