remove an argument that is no longer necessary from a few functions
Passing a boolean 'ghostly' argument to some functions that are also passed an NHFILE * is unnecessary now.
This commit is contained in:
@@ -23,11 +23,11 @@ static int NDECL(zerocomp_mgetc);
|
||||
|
||||
static void NDECL(find_lev_obj);
|
||||
static void FDECL(restlevchn, (NHFILE *));
|
||||
static void FDECL(restdamage, (NHFILE *, BOOLEAN_P));
|
||||
static void FDECL(restdamage, (NHFILE *));
|
||||
static void FDECL(restobj, (NHFILE *, struct obj *));
|
||||
static struct obj *FDECL(restobjchn, (NHFILE *, BOOLEAN_P, BOOLEAN_P));
|
||||
static struct obj *FDECL(restobjchn, (NHFILE *, BOOLEAN_P));
|
||||
static void FDECL(restmon, (NHFILE *, struct monst *));
|
||||
static struct monst *FDECL(restmonchn, (NHFILE *, BOOLEAN_P));
|
||||
static struct monst *FDECL(restmonchn, (NHFILE *));
|
||||
static struct fruit *FDECL(loadfruitchn, (NHFILE *));
|
||||
static void FDECL(freefruitchn, (struct fruit *));
|
||||
static void FDECL(ghostfruit, (struct obj *));
|
||||
@@ -142,13 +142,13 @@ NHFILE *nhfp;
|
||||
}
|
||||
|
||||
static void
|
||||
restdamage(nhfp, ghostly)
|
||||
restdamage(nhfp)
|
||||
NHFILE *nhfp;
|
||||
boolean ghostly;
|
||||
{
|
||||
unsigned int dmgcount = 0;
|
||||
int counter;
|
||||
struct damage *tmp_dam;
|
||||
boolean ghostly = (nhfp->ftype == NHF_BONESFILE);
|
||||
|
||||
if (nhfp->structlevel)
|
||||
mread(nhfp->fd, (genericptr_t) &dmgcount, sizeof(dmgcount));
|
||||
@@ -263,13 +263,14 @@ struct obj *otmp;
|
||||
}
|
||||
|
||||
static struct obj *
|
||||
restobjchn(nhfp, ghostly, frozen)
|
||||
restobjchn(nhfp, frozen)
|
||||
NHFILE *nhfp;
|
||||
boolean ghostly, frozen;
|
||||
boolean frozen;
|
||||
{
|
||||
register struct obj *otmp, *otmp2 = 0;
|
||||
register struct obj *first = (struct obj *) 0;
|
||||
int buflen = 0;
|
||||
boolean ghostly = (nhfp->ftype == NHF_BONESFILE);
|
||||
|
||||
while (1) {
|
||||
if (nhfp->structlevel)
|
||||
@@ -303,7 +304,7 @@ boolean ghostly, frozen;
|
||||
if (Has_contents(otmp)) {
|
||||
struct obj *otmp3;
|
||||
|
||||
otmp->cobj = restobjchn(nhfp, ghostly, Is_IceBox(otmp));
|
||||
otmp->cobj = restobjchn(nhfp, Is_IceBox(otmp));
|
||||
/* restore container back pointers */
|
||||
for (otmp3 = otmp->cobj; otmp3; otmp3 = otmp3->nobj)
|
||||
otmp3->ocontainer = otmp;
|
||||
@@ -424,13 +425,13 @@ struct monst *mtmp;
|
||||
}
|
||||
|
||||
static struct monst *
|
||||
restmonchn(nhfp, ghostly)
|
||||
restmonchn(nhfp)
|
||||
NHFILE *nhfp;
|
||||
boolean ghostly;
|
||||
{
|
||||
register struct monst *mtmp, *mtmp2 = 0;
|
||||
register struct monst *first = (struct monst *) 0;
|
||||
int offset, buflen = 0;
|
||||
boolean ghostly = (nhfp->ftype == NHF_BONESFILE);
|
||||
|
||||
while (1) {
|
||||
if (nhfp->structlevel)
|
||||
@@ -461,7 +462,7 @@ boolean ghostly;
|
||||
}
|
||||
if (mtmp->minvent) {
|
||||
struct obj *obj;
|
||||
mtmp->minvent = restobjchn(nhfp, ghostly, FALSE);
|
||||
mtmp->minvent = restobjchn(nhfp, FALSE);
|
||||
/* restore monster back pointer */
|
||||
for (obj = mtmp->minvent; obj; obj = obj->nobj)
|
||||
obj->ocarry = mtmp;
|
||||
@@ -679,13 +680,13 @@ unsigned int *stuckid, *steedid;
|
||||
|
||||
/* this stuff comes after potential aborted restore attempts */
|
||||
restore_killers(nhfp);
|
||||
restore_timers(nhfp, RANGE_GLOBAL, FALSE, 0L);
|
||||
restore_timers(nhfp, RANGE_GLOBAL, 0L);
|
||||
restore_light_sources(nhfp);
|
||||
|
||||
g.invent = restobjchn(nhfp, FALSE, FALSE);
|
||||
g.invent = restobjchn(nhfp, FALSE);
|
||||
|
||||
/* restore dangling (not on floor or in inventory) ball and/or chain */
|
||||
bc_obj = restobjchn(nhfp, FALSE, FALSE);
|
||||
bc_obj = restobjchn(nhfp, FALSE);
|
||||
while (bc_obj) {
|
||||
struct obj *nobj = bc_obj->nobj;
|
||||
|
||||
@@ -694,8 +695,8 @@ unsigned int *stuckid, *steedid;
|
||||
bc_obj->nobj = (struct obj *) 0;
|
||||
bc_obj = nobj;
|
||||
}
|
||||
g.migrating_objs = restobjchn(nhfp, FALSE, FALSE);
|
||||
g.migrating_mons = restmonchn(nhfp, FALSE);
|
||||
g.migrating_objs = restobjchn(nhfp, FALSE);
|
||||
g.migrating_mons = restmonchn(nhfp);
|
||||
|
||||
if (nhfp->structlevel) {
|
||||
mread(nhfp->fd, (genericptr_t) g.mvitals, sizeof g.mvitals);
|
||||
@@ -863,7 +864,7 @@ NHFILE *nhfp;
|
||||
|
||||
g.restoring = TRUE;
|
||||
get_plname_from_file(nhfp, g.plname);
|
||||
getlev(nhfp, 0, (xchar) 0, FALSE);
|
||||
getlev(nhfp, 0, (xchar) 0);
|
||||
if (!restgamestate(nhfp, &stuckid, &steedid)) {
|
||||
NHFILE tnhfp;
|
||||
|
||||
@@ -925,7 +926,7 @@ NHFILE *nhfp;
|
||||
if (restoreinfo.mread_flags == -1)
|
||||
break;
|
||||
}
|
||||
getlev(nhfp, 0, ltmp, FALSE);
|
||||
getlev(nhfp, 0, ltmp);
|
||||
#ifdef MICRO
|
||||
curs(WIN_MAP, 1 + dotcnt++, dotrow);
|
||||
if (dotcnt >= (COLNO - 1)) {
|
||||
@@ -946,7 +947,7 @@ NHFILE *nhfp;
|
||||
(void) validate(nhfp, (char *) 0);
|
||||
get_plname_from_file(nhfp, g.plname);
|
||||
|
||||
getlev(nhfp, 0, (xchar) 0, FALSE);
|
||||
getlev(nhfp, 0, (xchar) 0);
|
||||
close_nhfile(nhfp);
|
||||
restlevelstate(stuckid, steedid);
|
||||
g.program_state.something_worth_saving = 1; /* useful data now exists */
|
||||
@@ -1076,11 +1077,10 @@ char *reason;
|
||||
}
|
||||
|
||||
void
|
||||
getlev(nhfp, pid, lev, ghostly)
|
||||
getlev(nhfp, pid, lev)
|
||||
NHFILE *nhfp;
|
||||
int pid;
|
||||
xchar lev;
|
||||
boolean ghostly;
|
||||
{
|
||||
register struct trap *trap;
|
||||
register struct monst *mtmp;
|
||||
@@ -1089,6 +1089,7 @@ boolean ghostly;
|
||||
int hpid = 0;
|
||||
xchar dlvl = 0;
|
||||
int x, y;
|
||||
boolean ghostly = (nhfp->ftype == NHF_BONESFILE);
|
||||
#ifdef TOS
|
||||
short tlev;
|
||||
#endif
|
||||
@@ -1157,9 +1158,9 @@ boolean ghostly;
|
||||
else
|
||||
g.doorindex = 0;
|
||||
|
||||
restore_timers(nhfp, RANGE_LEVEL, ghostly, elapsed);
|
||||
restore_timers(nhfp, RANGE_LEVEL, elapsed);
|
||||
restore_light_sources(nhfp);
|
||||
fmon = restmonchn(nhfp, ghostly);
|
||||
fmon = restmonchn(nhfp);
|
||||
|
||||
/* rest_worm(fd); */ /* restore worm information */
|
||||
rest_worm(nhfp); /* restore worm information */
|
||||
@@ -1177,12 +1178,12 @@ boolean ghostly;
|
||||
}
|
||||
dealloc_trap(trap);
|
||||
|
||||
fobj = restobjchn(nhfp, ghostly, FALSE);
|
||||
fobj = restobjchn(nhfp, FALSE);
|
||||
find_lev_obj();
|
||||
/* restobjchn()'s `frozen' argument probably ought to be a callback
|
||||
routine so that we can check for objects being buried under ice */
|
||||
g.level.buriedobjlist = restobjchn(nhfp, ghostly, FALSE);
|
||||
g.billobjs = restobjchn(nhfp, ghostly, FALSE);
|
||||
g.level.buriedobjlist = restobjchn(nhfp, FALSE);
|
||||
g.billobjs = restobjchn(nhfp, FALSE);
|
||||
rest_engravings(nhfp);
|
||||
|
||||
/* reset level.monsters for new level */
|
||||
@@ -1219,8 +1220,8 @@ boolean ghostly;
|
||||
if (ghostly || (elapsed > 00 && elapsed > (long) rnd(10)))
|
||||
hide_monst(mtmp);
|
||||
}
|
||||
restdamage(nhfp, ghostly);
|
||||
rest_regions(nhfp, ghostly);
|
||||
restdamage(nhfp);
|
||||
rest_regions(nhfp);
|
||||
|
||||
if (ghostly) {
|
||||
/* Now get rid of all the temp fruits... */
|
||||
|
||||
Reference in New Issue
Block a user