Improved docs, fixed identation

This commit is contained in:
NHOrus 2017-06-17 17:24:45 +03:00 committed by Eric S. Raymond
parent 32fdd08d9b
commit a0a35d8c7b
4 changed files with 18 additions and 16 deletions

View file

@ -39,6 +39,8 @@ There have been no gameplay changes.
-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.
== BUGS ==

14
main.c
View file

@ -95,13 +95,13 @@ int main(int argc, char *argv[])
editline = prompt = false;
break;
case 'r':
rfp = fopen(optarg, "r");
if (rfp == NULL)
fprintf(stderr,
"advent: can't open save file %s for read\n",
optarg);
signal(SIGINT, sig_handler);
break;
rfp = fopen(optarg, "r");
if (rfp == NULL)
fprintf(stderr,
"advent: can't open save file %s for read\n",
optarg);
signal(SIGINT, sig_handler);
break;
case 's':
editline = false;
break;

View file

@ -73,8 +73,8 @@ necessarily pretty ugly by modern standards. Encryption and
checksumming have been discarded - it's pointless to try
tamper-proofing saves when everyone has the source code.
A -r command-line option has been added. It is functionally equivalent
to RESTORE command, but faster.
A -r command-line been added. When it is given (with a file
path argument) it is functionally equivalent to RESTORE command.
== Translation ==

View file

@ -93,14 +93,14 @@ int restore(FILE* fp){
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);
SETPRM(1,save.version/10,MOD(save.version,10));
SETPRM(3,VRSION/10,MOD(VRSION,10));
RSPEAK(VERSION_SKEW);
} else {
memcpy(&game, &save.game, sizeof(struct game_t));
OBJSND[BIRD] = save.bird;
OBJTXT[OYSTER] = save.bivalve;
game.zzword=RNDVOC(3,game.zzword);
memcpy(&game, &save.game, sizeof(struct game_t));
OBJSND[BIRD] = save.bird;
OBJTXT[OYSTER] = save.bivalve;
game.zzword=RNDVOC(3,game.zzword);
}
return GO_TOP;
}