projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More coverage improvements.
[open-adventure.git]
/
saveresume.c
diff --git
a/saveresume.c
b/saveresume.c
index 49e0021b91c55f4434935774ca29d12884357f8e..a3dbe968ebdaf4838ea2552d6c77b6e951143721 100644
(file)
--- a/
saveresume.c
+++ b/
saveresume.c
@@
-1,6
+1,7
@@
#include <stdlib.h>
#include <string.h>
#include <editline/readline.h>
#include <stdlib.h>
#include <string.h>
#include <editline/readline.h>
+#include <time.h>
#include "advent.h"
#include "dungeon.h"
#include "advent.h"
#include "dungeon.h"
@@
-10,7
+11,7
@@
* see the history.adoc file in the source distribution for discussion.
*/
* see the history.adoc file in the source distribution for discussion.
*/
-#define VRSION 2
6
/* bump on save format change */
+#define VRSION 2
7
/* bump on save format change */
/*
* If you change the first three members, the resume function may not properly
/*
* If you change the first three members, the resume function may not properly
@@
-31,12
+32,8
@@
struct save_t save;
int savefile(FILE *fp, long version)
/* Save game to file. No input or output from user. */
{
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.mode = -1;
-
save.version = (version == 0) ? VRSION : version;
memcpy(&save.game, &game, sizeof(struct game_t));
save.version = (version == 0) ? VRSION : version;
memcpy(&save.game, &game, sizeof(struct game_t));
@@
-88,7
+85,8
@@
int resume(void)
#endif
FILE *fp = NULL;
#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(RESUME_ABANDON);
if (!yes(arbitrary_messages[THIS_ACCEPTABLE], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN]))
return GO_CLEAROBJ;