projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change the name of the KEY array to avoid an upcoming macro clash.
[open-adventure.git]
/
saveresume.c
diff --git
a/saveresume.c
b/saveresume.c
index a0fa8a86ffcb023b47484843dbcd2ab0eeee837e..338615844b24cf6a945c4271d82a3ee887d2abf7 100644
(file)
--- a/
saveresume.c
+++ b/
saveresume.c
@@
-24,8
+24,6
@@
struct save_t {
long mode; /* not used, must be present for version detection */
long version;
struct game_t game;
long mode; /* not used, must be present for version detection */
long version;
struct game_t game;
- long bird;
- long bivalve;
};
struct save_t save;
};
struct save_t save;
@@
-43,8
+41,8
@@
int suspend(void)
long i, k;
FILE *fp = NULL;
long i, k;
FILE *fp = NULL;
-
RSPEAK
(SUSPEND_WARNING);
- if (!
YES
(arbitrary_messages[THIS_ACCEPTABLE], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN])) return GO_CLEAROBJ;
+
rspeak
(SUSPEND_WARNING);
+ if (!
yes
(arbitrary_messages[THIS_ACCEPTABLE], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN])) return GO_CLEAROBJ;
game.saved = game.saved + 5;
while (fp == NULL) {
game.saved = game.saved + 5;
while (fp == NULL) {
@@
-57,17
+55,15
@@
int suspend(void)
linenoiseFree(name);
}
linenoiseFree(name);
}
-
DATIME
(&i, &k);
+
datime
(&i, &k);
k = i + 650 * k;
save.savetime = k;
save.mode = -1;
save.version = VRSION;
memcpy(&save.game, &game, sizeof(struct game_t));
k = i + 650 * k;
save.savetime = k;
save.mode = -1;
save.version = VRSION;
memcpy(&save.game, &game, sizeof(struct game_t));
- save.bird = OBJSND[BIRD];
- save.bivalve = OBJTXT[OYSTER];
IGNORE(fwrite(&save, sizeof(struct save_t), 1, fp));
fclose(fp);
IGNORE(fwrite(&save, sizeof(struct save_t), 1, fp));
fclose(fp);
-
RSPEAK
(RESUME_HELP);
+
rspeak
(RESUME_HELP);
exit(0);
}
exit(0);
}
@@
-82,8
+78,8
@@
int resume(void)
FILE *fp = NULL;
if (game.loc != 1 || game.abbrev[1] != 1) {
FILE *fp = NULL;
if (game.loc != 1 || game.abbrev[1] != 1) {
-
RSPEAK
(RESUME_ABANDON);
- if (!
YES
(arbitrary_messages[THIS_ACCEPTABLE], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN])) return GO_CLEAROBJ;
+
rspeak
(RESUME_ABANDON);
+ if (!
yes
(arbitrary_messages[THIS_ACCEPTABLE], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN])) return GO_CLEAROBJ;
}
while (fp == NULL) {
}
while (fp == NULL) {
@@
-111,14
+107,10
@@
int restore(FILE* fp)
IGNORE(fread(&save, sizeof(struct save_t), 1, fp));
fclose(fp);
if (save.version != VRSION) {
IGNORE(fread(&save, sizeof(struct save_t), 1, fp));
fclose(fp);
if (save.version != VRSION) {
- SETPRM(1, save.version / 10, MOD(save.version, 10));
- SETPRM(3, VRSION / 10, MOD(VRSION, 10));
- RSPEAK(VERSION_SKEW);
+ rspeak(VERSION_SKEW, save.version / 10, MOD(save.version, 10), VRSION / 10, MOD(VRSION, 10));
} else {
memcpy(&game, &save.game, sizeof(struct game_t));
} else {
memcpy(&game, &save.game, sizeof(struct game_t));
- OBJSND[BIRD] = save.bird;
- OBJTXT[OYSTER] = save.bivalve;
- game.zzword = RNDVOC(3, game.zzword);
+ game.zzword = rndvoc(3, game.zzword);
}
return GO_TOP;
}
}
return GO_TOP;
}