Improved docs, fixed identation
This commit is contained in:
parent
32fdd08d9b
commit
a0a35d8c7b
4 changed files with 18 additions and 16 deletions
|
@ -39,6 +39,8 @@ There have been no gameplay changes.
|
||||||
|
|
||||||
-s:: Suppress Emacs-like line editing and command history.
|
-s:: Suppress Emacs-like line editing and command history.
|
||||||
|
|
||||||
|
-r:: Restore game from specified file
|
||||||
|
|
||||||
-o:: Old-style. Restores original interface, no prompt or line editing.
|
-o:: Old-style. Restores original interface, no prompt or line editing.
|
||||||
|
|
||||||
== BUGS ==
|
== BUGS ==
|
||||||
|
|
14
main.c
14
main.c
|
@ -95,13 +95,13 @@ int main(int argc, char *argv[])
|
||||||
editline = prompt = false;
|
editline = prompt = false;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
rfp = fopen(optarg, "r");
|
rfp = fopen(optarg, "r");
|
||||||
if (rfp == NULL)
|
if (rfp == NULL)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"advent: can't open save file %s for read\n",
|
"advent: can't open save file %s for read\n",
|
||||||
optarg);
|
optarg);
|
||||||
signal(SIGINT, sig_handler);
|
signal(SIGINT, sig_handler);
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
editline = false;
|
editline = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -73,8 +73,8 @@ necessarily pretty ugly by modern standards. Encryption and
|
||||||
checksumming have been discarded - it's pointless to try
|
checksumming have been discarded - it's pointless to try
|
||||||
tamper-proofing saves when everyone has the source code.
|
tamper-proofing saves when everyone has the source code.
|
||||||
|
|
||||||
A -r command-line option has been added. It is functionally equivalent
|
A -r command-line been added. When it is given (with a file
|
||||||
to RESTORE command, but faster.
|
path argument) it is functionally equivalent to RESTORE command.
|
||||||
|
|
||||||
== Translation ==
|
== Translation ==
|
||||||
|
|
||||||
|
|
14
saveresume.c
14
saveresume.c
|
@ -93,14 +93,14 @@ int restore(FILE* fp){
|
||||||
IGNORE(fread(&save, sizeof(struct save_t), 1, fp));
|
IGNORE(fread(&save, sizeof(struct save_t), 1, fp));
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
if (save.version != VRSION) {
|
if (save.version != VRSION) {
|
||||||
SETPRM(1,save.version/10,MOD(save.version,10));
|
SETPRM(1,save.version/10,MOD(save.version,10));
|
||||||
SETPRM(3,VRSION/10,MOD(VRSION,10));
|
SETPRM(3,VRSION/10,MOD(VRSION,10));
|
||||||
RSPEAK(VERSION_SKEW);
|
RSPEAK(VERSION_SKEW);
|
||||||
} else {
|
} else {
|
||||||
memcpy(&game, &save.game, sizeof(struct game_t));
|
memcpy(&game, &save.game, sizeof(struct game_t));
|
||||||
OBJSND[BIRD] = save.bird;
|
OBJSND[BIRD] = save.bird;
|
||||||
OBJTXT[OYSTER] = save.bivalve;
|
OBJTXT[OYSTER] = save.bivalve;
|
||||||
game.zzword=RNDVOC(3,game.zzword);
|
game.zzword=RNDVOC(3,game.zzword);
|
||||||
}
|
}
|
||||||
return GO_TOP;
|
return GO_TOP;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue