#include <stdlib.h>
#include <string.h>
#include <editline/readline.h>
+#include <time.h>
#include "advent.h"
#include "dungeon.h"
* see the history.adoc file in the source distribution for discussion.
*/
-#define VRSION 26 /* bump on save format change */
+#define VRSION 27 /* bump on save format change */
/*
* If you change the first three members, the resume function may not properly
int savefile(FILE *fp, long version)
/* Save game to file. No input or output from user. */
{
- long i, k;
- datime(&i, &k);
- k = i + 650 * k;
- save.savetime = k;
+ save.savetime = time(NULL);
save.mode = -1;
-
save.version = (version == 0) ? VRSION : version;
memcpy(&save.game, &game, sizeof(struct game_t));
#endif
FILE *fp = NULL;
- if (game.loc != 1 || game.abbrev[1] != 1) {
+ 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(VERSION_SKEW, save.version / 10, MOD(save.version, 10), VRSION / 10, MOD(VRSION, 10));
} else {
memcpy(&game, &save.game, sizeof(struct game_t));
- //game.zzword = rndvoc(3, game.zzword);
- make_zzword(game.zzword);
}
return GO_TOP;
}