Make WIZARD unconditional.
This commit is contained in:
25
src/bones.c
25
src/bones.c
@@ -312,10 +312,7 @@ can_make_bones()
|
||||
|
||||
if(depth(&u.uz) <= 0 || /* bulletproofing for endgame */
|
||||
(!rn2(1 + (depth(&u.uz)>>2)) /* fewer ghosts on low levels */
|
||||
#ifdef WIZARD
|
||||
&& !wizard
|
||||
#endif
|
||||
)) return FALSE;
|
||||
&& !wizard)) return FALSE;
|
||||
/* don't let multiple restarts generate multiple copies of objects
|
||||
* in bones files */
|
||||
if (discover) return FALSE;
|
||||
@@ -344,23 +341,19 @@ struct obj *corpse;
|
||||
fd = open_bonesfile(&u.uz, &bonesid);
|
||||
if (fd >= 0) {
|
||||
(void) close(fd);
|
||||
#ifdef WIZARD
|
||||
if (wizard) {
|
||||
if (yn("Bones file already exists. Replace it?") == 'y') {
|
||||
if (delete_bonesfile(&u.uz)) goto make_bones;
|
||||
else pline("Cannot unlink old bones.");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* compression can change the file's name, so must
|
||||
wait until after any attempt to delete this file */
|
||||
compress_bonesfile();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef WIZARD
|
||||
make_bones:
|
||||
#endif
|
||||
unleash_all();
|
||||
/* in case these characters are not in their home bases */
|
||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
||||
@@ -488,10 +481,8 @@ struct obj *corpse;
|
||||
|
||||
fd = create_bonesfile(&u.uz, &bonesid, whynot);
|
||||
if(fd < 0) {
|
||||
#ifdef WIZARD
|
||||
if(wizard)
|
||||
pline1(whynot);
|
||||
#endif
|
||||
/* bones file creation problems are silent to the player.
|
||||
* Keep it that way, but place a clue into the paniclog.
|
||||
*/
|
||||
@@ -520,10 +511,8 @@ struct obj *corpse;
|
||||
savefruitchn(fd, COUNT_SAVE);
|
||||
bflush(fd);
|
||||
if (bytes_counted > freediskspace(bones)) { /* not enough room */
|
||||
# ifdef WIZARD
|
||||
if (wizard)
|
||||
pline("Insufficient space to create bones file.");
|
||||
# endif
|
||||
(void) close(fd);
|
||||
cancel_bonesfile();
|
||||
return;
|
||||
@@ -556,23 +545,18 @@ getbones()
|
||||
|
||||
/* wizard check added by GAN 02/05/87 */
|
||||
if(rn2(3) /* only once in three times do we find bones */
|
||||
#ifdef WIZARD
|
||||
&& !wizard
|
||||
#endif
|
||||
) return(0);
|
||||
if(no_bones_level(&u.uz)) return(0);
|
||||
fd = open_bonesfile(&u.uz, &bonesid);
|
||||
if (fd < 0) return(0);
|
||||
|
||||
if (validate(fd, bones) != 0) {
|
||||
#ifdef WIZARD
|
||||
if (!wizard)
|
||||
#endif
|
||||
pline("Discarding unuseable bones; no need to panic...");
|
||||
ok = FALSE;
|
||||
} else {
|
||||
ok = TRUE;
|
||||
#ifdef WIZARD
|
||||
if(wizard) {
|
||||
if(yn("Get bones?") == 'n') {
|
||||
(void) close(fd);
|
||||
@@ -580,7 +564,6 @@ getbones()
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
mread(fd, (genericptr_t) &c, sizeof c); /* length incl. '\0' */
|
||||
mread(fd, (genericptr_t) oldbonesid, (unsigned) c); /* DD.nnn */
|
||||
if (strcmp(bonesid, oldbonesid) != 0) {
|
||||
@@ -588,12 +571,10 @@ getbones()
|
||||
|
||||
Sprintf(errbuf, "This is bones level '%s', not '%s'!",
|
||||
oldbonesid, bonesid);
|
||||
#ifdef WIZARD
|
||||
if (wizard) {
|
||||
pline1(errbuf);
|
||||
ok = FALSE; /* won't die of trickery */
|
||||
}
|
||||
#endif
|
||||
trickery(errbuf);
|
||||
} else {
|
||||
register struct monst *mtmp;
|
||||
@@ -610,7 +591,7 @@ getbones()
|
||||
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
||||
if (has_mname(mtmp)) sanitize_name(MNAME(mtmp));
|
||||
if (mtmp->mhpmax == DEFUNCT_MONSTER) {
|
||||
#if defined(DEBUG) && defined(WIZARD)
|
||||
#if defined(DEBUG)
|
||||
if (wizard)
|
||||
pline("Removing defunct monster %s from bones.",
|
||||
mtmp->data->mname);
|
||||
@@ -627,14 +608,12 @@ getbones()
|
||||
(void) close(fd);
|
||||
sanitize_engravings();
|
||||
|
||||
#ifdef WIZARD
|
||||
if(wizard) {
|
||||
if(yn("Unlink bones?") == 'n') {
|
||||
compress_bonesfile();
|
||||
return(ok);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!delete_bonesfile(&u.uz)) {
|
||||
/* When N games try to simultaneously restore the same
|
||||
* bones file, N-1 of them will fail to delete it
|
||||
|
||||
Reference in New Issue
Block a user