Merge branch 'NetHack-3.7' into to500

This commit is contained in:
nhmall
2026-04-27 15:03:53 -04:00
4 changed files with 30 additions and 10 deletions
+1
View File
@@ -3889,6 +3889,7 @@ extern void wizcustom_callback(winid win, int glyphnum, char *id);
extern int wiz_display_macros(void);
extern int wiz_mon_diff(void);
extern int wiz_objprobs(void);
extern int wiz_show_nhuuid(void);
#endif
extern void sanity_check(void);
+2
View File
@@ -1989,6 +1989,8 @@ struct ext_func_tab extcmdlist[] = {
wiz_rumor_check, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL },
{ '\0', "wizseenv", "show map locations' seen vectors",
wiz_show_seenv, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL },
{ '\0', "wizshownhuuid", "show NHUUID for this game",
wiz_show_nhuuid, AUTOCOMPLETE | WIZMODECMD, NULL },
{ '\0', "wizsmell", "smell monster",
wiz_smell, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL },
{ '\0', "wiztelekinesis", "telekinesis",
+19 -10
View File
@@ -660,8 +660,9 @@ create_levelfile(int lev, char errbuf[])
Sprintf(errbuf,
"Cannot create file \"%s\" for level %d (errno %d).",
gl.lock, lev, errno);
#if defined(MSDOS)
setmode(nhfp->fd, O_BINARY);
#if defined(MSDOS) || defined(WIN32)
if (nhfp->fd >= 0)
(void) setmode(nhfp->fd, O_BINARY);
#endif
}
nhfp = viable_nhfile(nhfp);
@@ -705,8 +706,9 @@ open_levelfile(int lev, char errbuf[])
Sprintf(errbuf,
"Cannot open file \"%s\" for level %d (errno %d).",
gl.lock, lev, errno);
#if defined(MSDOS)
setmode(nhfp->fd, O_BINARY);
#if defined(MSDOS) || defined(WIN32)
if (nhfp->fd >= 0)
(void) setmode(nhfp->fd, O_BINARY);
#endif
}
nhfp = viable_nhfile(nhfp);
@@ -883,8 +885,9 @@ create_bonesfile(d_level *lev, char **bonesid, char errbuf[])
#endif /* ?MICRO || WIN32 */
if (nhfp->fd < 0)
failed = errno;
#if defined(MSDOS)
setmode(nhfp->fd, O_BINARY);
#if defined(MSDOS) || defined(WIN32)
if (nhfp->fd >= 0)
(void) setmode(nhfp->fd, O_BINARY);
#endif
}
if (failed && errbuf) /* failure explanation */
@@ -976,8 +979,9 @@ open_bonesfile(d_level *lev, char **bonesid)
#else
nhfp->fd = open(fq_bones, O_RDONLY | O_BINARY, 0);
#endif
#if defined(MSDOS)
setmode(nhfp->fd, O_BINARY);
#if defined(MSDOS) || defined(WIN32)
if (nhfp->fd >= 0)
(void) setmode(nhfp->fd, O_BINARY);
#endif
}
}
@@ -1188,8 +1192,8 @@ create_savefile(void)
#endif
#endif /* MICRO || WIN32 */
#if defined(MSDOS) || defined(WIN32)
if (nhfp->fd >= 0)
(void) setmode(nhfp->fd, O_BINARY);
if (nhfp->fd >= 0)
(void) setmode(nhfp->fd, O_BINARY);
#endif
}
}
@@ -2989,6 +2993,9 @@ recover_savefile(void)
if (savewrite_failure)
goto cleanup;
if (snhfp->structlevel)
bufoff(snhfp->fd);
/* TODO: this is not a single byte, so a big-endian byte swap
* might be necessary here, if anyone is concerned about big-endian */
Sfo_int(snhfp, &pltmpsiz, "plname-size");
@@ -3041,6 +3048,8 @@ recover_savefile(void)
}
}
}
if (snhfp->structlevel)
bufon(snhfp->fd);
close_nhfile(snhfp);
/*
* We have a successful savefile!
+8
View File
@@ -1777,6 +1777,14 @@ wiz_display_macros(void)
return ECMD_OK;
}
/* the #wizshownhuuid command */
int
wiz_show_nhuuid(void)
{
pline("The NHUUID for this game is { %s }.", svn.nhuuid);
return ECMD_OK;
}
/* the #wizmondiff command */
int
wiz_mon_diff(void)