more storing only relative times in save & bones
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
||||||
* and save files.
|
* and save files.
|
||||||
*/
|
*/
|
||||||
#define EDITLEVEL 139
|
#define EDITLEVEL 140
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Development status possibilities.
|
* Development status possibilities.
|
||||||
|
|||||||
@@ -353,6 +353,7 @@ restmon(NHFILE *nhfp, struct monst *mtmp)
|
|||||||
Sfi_edog(nhfp, EDOG(mtmp), "monst-edog");
|
Sfi_edog(nhfp, EDOG(mtmp), "monst-edog");
|
||||||
/* save or bones held a relative time */
|
/* save or bones held a relative time */
|
||||||
relative_time_to_moves(&EDOG(mtmp)->droptime);
|
relative_time_to_moves(&EDOG(mtmp)->droptime);
|
||||||
|
relative_time_to_moves(&EDOG(mtmp)->hungrytime);
|
||||||
/* sanity check to prevent rn2(0) */
|
/* sanity check to prevent rn2(0) */
|
||||||
if (EDOG(mtmp)->apport <= 0) {
|
if (EDOG(mtmp)->apport <= 0) {
|
||||||
EDOG(mtmp)->apport = 1;
|
EDOG(mtmp)->apport = 1;
|
||||||
@@ -552,6 +553,8 @@ restgamestate(NHFILE *nhfp)
|
|||||||
#endif /* SFCTOOL */
|
#endif /* SFCTOOL */
|
||||||
newgamecontext = svc.context; /* copy statically init'd context */
|
newgamecontext = svc.context; /* copy statically init'd context */
|
||||||
Sfi_context_info(nhfp, &svc.context, "gamestate-context");
|
Sfi_context_info(nhfp, &svc.context, "gamestate-context");
|
||||||
|
relative_time_to_moves(&svc.context.seer_turn);
|
||||||
|
relative_time_to_moves(&svc.context.digging.lastdigtime);
|
||||||
svc.context.warntype.species = (ismnum(svc.context.warntype.speciesidx))
|
svc.context.warntype.species = (ismnum(svc.context.warntype.speciesidx))
|
||||||
? &mons[svc.context.warntype.speciesidx]
|
? &mons[svc.context.warntype.speciesidx]
|
||||||
: (struct permonst *) 0;
|
: (struct permonst *) 0;
|
||||||
|
|||||||
@@ -270,7 +270,12 @@ savegamestate(NHFILE *nhfp)
|
|||||||
program_state.saving++; /* caller should/did already set this... */
|
program_state.saving++; /* caller should/did already set this... */
|
||||||
uid = (unsigned long) getuid();
|
uid = (unsigned long) getuid();
|
||||||
Sfo_ulong(nhfp, &uid, "gamestate-uid");
|
Sfo_ulong(nhfp, &uid, "gamestate-uid");
|
||||||
|
moves_to_relative_time(&svc.context.seer_turn);
|
||||||
|
moves_to_relative_time(&svc.context.digging.lastdigtime);
|
||||||
Sfo_context_info(nhfp, &svc.context, "gamestate-context");
|
Sfo_context_info(nhfp, &svc.context, "gamestate-context");
|
||||||
|
relative_time_to_moves(&svc.context.seer_turn);
|
||||||
|
relative_time_to_moves(&svc.context.digging.lastdigtime);
|
||||||
|
|
||||||
Sfo_flag(nhfp, &flags, "gamestate-flags");
|
Sfo_flag(nhfp, &flags, "gamestate-flags");
|
||||||
urealtime.finish_time = getnow();
|
urealtime.finish_time = getnow();
|
||||||
urealtime.realtime += timet_delta(urealtime.finish_time,
|
urealtime.realtime += timet_delta(urealtime.finish_time,
|
||||||
@@ -855,8 +860,10 @@ savemon(NHFILE *nhfp, struct monst *mtmp)
|
|||||||
if (buflen > 0) {
|
if (buflen > 0) {
|
||||||
/* we only store relative times in save and bones */
|
/* we only store relative times in save and bones */
|
||||||
moves_to_relative_time(&EDOG(mtmp)->droptime);
|
moves_to_relative_time(&EDOG(mtmp)->droptime);
|
||||||
|
moves_to_relative_time(&EDOG(mtmp)->hungrytime);
|
||||||
Sfo_edog(nhfp, EDOG(mtmp), "monst-edog");
|
Sfo_edog(nhfp, EDOG(mtmp), "monst-edog");
|
||||||
relative_time_to_moves(&EDOG(mtmp)->droptime);
|
relative_time_to_moves(&EDOG(mtmp)->droptime);
|
||||||
|
relative_time_to_moves(&EDOG(mtmp)->hungrytime);
|
||||||
}
|
}
|
||||||
buflen = EBONES(mtmp) ? (int) sizeof (struct ebones) : 0;
|
buflen = EBONES(mtmp) ? (int) sizeof (struct ebones) : 0;
|
||||||
Sfo_int(nhfp, &buflen, "monst-ebones_length");
|
Sfo_int(nhfp, &buflen, "monst-ebones_length");
|
||||||
|
|||||||
Reference in New Issue
Block a user