remove old bonesid workaround

Noticed when the comment about "this can go away when compatibility
with 3.6.x is no longer needed" was modified recently.  Make it and
the code it applied to go away.
This commit is contained in:
PatR
2020-07-17 10:14:24 -07:00
parent eab7a12b77
commit 74e0be478a
3 changed files with 29 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 bones.c $NHDT-Date: 1593953344 2020/07/05 12:49:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.100 $ */
/* NetHack 3.6 bones.c $NHDT-Date: 1595006054 2020/07/17 17:14:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.102 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985,1993. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -531,8 +531,10 @@ struct obj *corpse;
store_version(nhfp);
store_savefileinfo(nhfp);
if (nhfp->structlevel) {
/* if a bones pool digit is in use, it precedes the bonesid
string and isn't recorded in the file */
bwrite(nhfp->fd, (genericptr_t) &c, sizeof c);
bwrite(nhfp->fd, (genericptr_t) bonesid, (unsigned) c); /* DD.nnn */
bwrite(nhfp->fd, (genericptr_t) bonesid, (unsigned) c); /* DD.nn */
savefruitchn(nhfp);
}
update_mlstmv(); /* update monsters for eventual restoration */
@@ -585,22 +587,18 @@ getbones()
}
}
if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) &c, sizeof c); /* length incl. '\0' */
mread(nhfp->fd, (genericptr_t) oldbonesid, (unsigned) c); /* DD.nnn */
/* if a bones pool digit is in use, it precedes the bonesid
string and wasn't recorded in the file */
mread(nhfp->fd, (genericptr_t) &c,
sizeof c); /* length including terminating '\0' */
mread(nhfp->fd, (genericptr_t) oldbonesid,
(unsigned) c); /* DD.nn or Qrrr.n for role rrr */
}
if (strcmp(bonesid, oldbonesid) != 0
/* from 3.3.0 through 3.6.0, bones in the quest branch stored
a bogus bonesid in the file; 3.6.1 fixed that, but for
3.6.0 bones to remain compatible, we need an extra test;
once compatibility with 3.6.x goes away, this can too
(we don't try to make this conditional upon the value of
VERSION_COMPATIBILITY) */
&& (strlen(bonesid) <= 2
|| strcmp(bonesid + 2, oldbonesid) != 0)) {
if (strcmp(bonesid, oldbonesid) != 0) {
char errbuf[BUFSZ];
Sprintf(errbuf, "This is bones level '%s', not '%s'!", oldbonesid,
bonesid);
Sprintf(errbuf, "This is bones level '%s', not '%s'!",
oldbonesid, bonesid);
if (wizard) {
pline1(errbuf);
ok = FALSE; /* won't die of trickery */