more empty bonesfile

This commit is contained in:
nhmall
2026-04-30 09:08:29 -04:00
parent 7fdaf92367
commit c5b258c2cf
3 changed files with 9 additions and 7 deletions
+1
View File
@@ -798,6 +798,7 @@ struct sinfo {
int config_error_ready; /* config_error_add is ready, available */
int beyond_savefile_load; /* set when past savefile loading */
int savefile_completed; /* savefile has completed writing */
int reading_bonesfile; /* in the midst of trying to read bones file */
#ifdef PANICLOG
int in_paniclog; /* writing a panicloc entry */
#endif
+6 -6
View File
@@ -659,19 +659,19 @@ getbones(void)
return 0;
}
restoreinfo.mread_flags = 1; /* return despite error for a bones file */
program_state.reading_bonesfile = 1;
if (validate(nhfp, gb.bones, FALSE) != SF_UPTODATE) {
if (!wizard)
pline("Discarding unusable bones; no need to panic...");
ok = FALSE;
restoreinfo.mread_flags = 0;
program_state.reading_bonesfile = 0;
} else {
ok = TRUE;
if (wizard) {
if (y_n("Get bones?") == 'n') {
close_nhfile(nhfp);
compress_bonesfile();
restoreinfo.mread_flags = 0;
program_state.reading_bonesfile = 0;
return 0;
}
}
@@ -687,7 +687,7 @@ getbones(void)
close_nhfile(nhfp);
compress_bonesfile();
/* ToDo: maybe unlink these problematic bones? */
restoreinfo.mread_flags = 0;
program_state.reading_bonesfile = 0;
return 0;
}
if (strcmp(bonesid, oldbonesid) != 0) {
@@ -699,7 +699,7 @@ getbones(void)
pline1(errbuf);
ok = FALSE; /* won't die of trickery */
}
restoreinfo.mread_flags = 0;
program_state.reading_bonesfile = 0;
trickery(errbuf);
} else {
struct monst *mtmp;
@@ -731,8 +731,8 @@ getbones(void)
fix_shop_damage();
}
}
restoreinfo.mread_flags = 0;
close_nhfile(nhfp);
program_state.reading_bonesfile = 0;
sanitize_engravings();
u.uroleplay.numbones++;
+2 -1
View File
@@ -572,7 +572,8 @@ mread(int fd, genericptr_t buf, unsigned len)
/* Not perfect, but we don't have ssize_t available. */
rlen = (readLenType) read(fd, buf, (readLenType) len);
if ((readLenType) rlen != (readLenType) len) {
if (restoreinfo.mread_flags == 1) { /* means "return anyway" */
if ((restoreinfo.mread_flags == 1) /* means "return anyway" */
|| (program_state.reading_bonesfile == 1)) {
restoreinfo.mread_flags = -1;
return;
} else {