'struct former' -> 'struct ebones'

Some variants were already using a similar approach
using a struct called 'ebones', so adopt the same naming
so NetHack-3.7, hardfought, and some variants are using
the same name.

As before there are fields in the struct that are not
currently used by NetHack-3.7, but the intent is that
hardfought save and bones files can be loaded by
NetHack-3.7 without code modification, for debugging
bug reports.

This invalidates existing save and bones files.
This commit is contained in:
nhmall
2025-02-04 15:16:42 -05:00
parent b44a547153
commit c24786430f
13 changed files with 108 additions and 71 deletions

View File

@@ -943,12 +943,12 @@ savemon(NHFILE *nhfp, struct monst *mtmp)
if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) EDOG(mtmp), buflen);
}
buflen = FORMER(mtmp) ? (int) sizeof (struct former_incarnation) : 0;
buflen = EBONES(mtmp) ? (int) sizeof (struct ebones) : 0;
if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof (int));
if (buflen > 0) {
if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t) FORMER(mtmp), buflen);
bwrite(nhfp->fd, (genericptr_t) EBONES(mtmp), buflen);
}
/* mcorpsenm is inline int rather than pointer to something,
so doesn't need to be preceded by a length field */