Merge remote-tracking branch 'origin/NetHack-3.6.0'

This commit is contained in:
keni
2017-09-24 13:58:17 -04:00
160 changed files with 6441 additions and 1061 deletions

View File

@@ -436,7 +436,7 @@ amii_askname()
if (*plname == '\33') {
clearlocks();
exit_nhwindows(NULL);
terminate(0);
nh_terminate(0);
}
}
@@ -543,7 +543,7 @@ amii_player_selection()
CloseShWindow( cwin );
clearlocks();
exit_nhwindows(NULL);
terminate(0);
nh_terminate(0);
}
else
DisplayBeep( NULL );
@@ -573,7 +573,7 @@ amii_player_selection()
CloseShWindow( cwin );
clearlocks();
exit_nhwindows(NULL);
terminate(0);
nh_terminate(0);
break;
}
}
@@ -1368,7 +1368,7 @@ amii_player_selection()
free((genericptr_t) selected);
clearlocks();
exit_nhwindows(NULL);
terminate(0);
nh_terminate(0);
/*NOTREACHED*/
return;
}

View File

@@ -776,7 +776,9 @@ char *argv[];
NHWinMainInit();
}
*/
config_error_init(FALSE, "command line", FALSE);
choose_windows(&argv[0][2]);
config_error_done();
break;
#endif
case '@':

View File

@@ -26,6 +26,7 @@ CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
CFLAGS+=-DTIMED_DELAY
CFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
CFLAGS+=-DDUMPLOG
CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
LINK=$(CC)
# Only needed for GLIBC stack trace:

View File

@@ -98,6 +98,14 @@ MAXPLAYERS=10
# %N first character of player name
#DUMPLOGFILE=/tmp/nethack.%n.%d.log
# Number of bones file pools.
# The pool you belong to is determined at game start. You will
# load and save bones only from that pool. Generally useful
# for public servers only.
# Changing this might make existing bones inaccessible.
# Disabled by setting to 0, or commenting out.
#BONES_POOLS=10
# Try to get more info in case of a program bug or crash. Only used
# if the program is built with the PANICTRACE compile-time option enabled.
# By default PANICTRACE is enabled if BETA is defined, otherwise disabled.

View File

@@ -97,19 +97,18 @@ char *argv[];
choose_windows(DEFAULT_WINDOW_SYS);
#ifdef CHDIR /* otherwise no chdir() */
/*
* See if we must change directory to the playground.
* (Perhaps hack runs suid and playground is inaccessible
* for the player.)
* The environment variable HACKDIR is overridden by a
* -d command line option (must be the first option given)
*/
/*
* See if we must change directory to the playground.
* (Perhaps hack runs suid and playground is inaccessible
* for the player.)
* The environment variable HACKDIR is overridden by a
* -d command line option (must be the first option given).
*/
dir = nh_getenv("NETHACKDIR");
if (!dir)
dir = nh_getenv("HACKDIR");
#endif
if (argc > 1) {
#ifdef CHDIR
if (!strncmp(argv[1], "-d", 2) && argv[1][2] != 'e') {
/* avoid matching "-dec" for DECgraphics; since the man page
* says -d directory, hope nobody's using -desomething_else
@@ -127,30 +126,33 @@ char *argv[];
if (!*dir)
error("Flag -d must be followed by a directory name.");
}
if (argc > 1)
}
#endif /* CHDIR */
/*
* Now we know the directory containing 'record' and
* may do a prscore(). Exclude `-style' - it's a Qt option.
*/
if (!strncmp(argv[1], "-s", 2) && strncmp(argv[1], "-style", 6)) {
if (argc > 1) {
/*
* Now we know the directory containing 'record' and
* may do a prscore(). Exclude `-style' - it's a Qt option.
*/
if (!strncmp(argv[1], "-s", 2) && strncmp(argv[1], "-style", 6)) {
#ifdef CHDIR
chdirx(dir, 0);
chdirx(dir, 0);
#endif
#ifdef SYSCF
initoptions();
initoptions();
#endif
#ifdef PANICTRACE
ARGV0 = argv[0]; /* save for possible stack trace */
ARGV0 = hname; /* save for possible stack trace */
#ifndef NO_SIGNAL
panictrace_setsignals(TRUE);
panictrace_setsignals(TRUE);
#endif
#endif
prscore(argc, argv);
exit(EXIT_SUCCESS);
}
}
prscore(argc, argv);
/* FIXME: shouldn't this be using nh_terminate() to free
up any memory allocated by initoptions() */
exit(EXIT_SUCCESS);
}
} /* argc > 1 */
/*
* Change directories before we initialize the window system so
@@ -168,7 +170,7 @@ char *argv[];
#endif
initoptions();
#ifdef PANICTRACE
ARGV0 = argv[0]; /* save for possible stack trace */
ARGV0 = hname; /* save for possible stack trace */
#ifndef NO_SIGNAL
panictrace_setsignals(TRUE);
#endif
@@ -217,7 +219,7 @@ char *argv[];
* dash matches role, race, gender, or alignment.
*/
/* guard against user names with hyphens in them */
int len = strlen(plname);
int len = (int) strlen(plname);
/* append the current role, if any, so that last dash is ours */
if (++len < (int) sizeof plname)
(void) strncat(strcat(plname, "-"), pl_character,
@@ -252,17 +254,17 @@ char *argv[];
dlb_init(); /* must be before newgame() */
/*
* Initialize the vision system. This must be before mklev() on a
* new game or before a level restore on a saved game.
* Initialize the vision system. This must be before mklev() on a
* new game or before a level restore on a saved game.
*/
vision_init();
display_gamewindows();
/*
* First, try to find and restore a save file for specified character.
* We'll return here if new game player_selection() renames the hero.
*/
/*
* First, try to find and restore a save file for specified character.
* We'll return here if new game player_selection() renames the hero.
*/
attempt_restore:
if ((fd = restore_saved_game()) >= 0) {
const char *fq_save = fqname(SAVEF, SAVEPREFIX, 1);
@@ -283,9 +285,10 @@ attempt_restore:
resuming = TRUE; /* not starting new game */
wd_message();
if (discover || wizard) {
if (yn("Do you want to keep the save file?") == 'n')
/* this seems like a candidate for paranoid_confirmation... */
if (yn("Do you want to keep the save file?") == 'n') {
(void) delete_savefile();
else {
} else {
(void) chmod(fq_save, FCMASK); /* back to readable */
nh_compress(fq_save);
}
@@ -316,10 +319,12 @@ attempt_restore:
wd_message();
}
/* moveloop() never returns but isn't flagged NORETURN */
moveloop(resuming);
exit(EXIT_SUCCESS);
/*NOTREACHED*/
return (0);
return 0;
}
static void
@@ -363,14 +368,15 @@ char *argv[];
break;
#endif
case 'u':
if (argv[0][2])
(void) strncpy(plname, argv[0] + 2, sizeof(plname) - 1);
else if (argc > 1) {
if (argv[0][2]) {
(void) strncpy(plname, argv[0] + 2, sizeof plname - 1);
} else if (argc > 1) {
argc--;
argv++;
(void) strncpy(plname, argv[0], sizeof(plname) - 1);
} else
(void) strncpy(plname, argv[0], sizeof plname - 1);
} else {
raw_print("Player name expected after -u");
}
break;
case 'I':
case 'i':
@@ -405,7 +411,9 @@ char *argv[];
}
break;
case 'w': /* windowtype */
config_error_init(FALSE, "command line", FALSE);
choose_windows(&argv[0][2]);
config_error_done();
break;
case '@':
flags.randomall = 1;
@@ -455,10 +463,10 @@ boolean wr;
(void) setuid(getuid()); /* Ron Wessels */
#endif
} else {
/* non-default data files is a sign that scores may not be
* compatible, or perhaps that a binary not fitting this
* system's layout is being used.
*/
/* non-default data files is a sign that scores may not be
* compatible, or perhaps that a binary not fitting this
* system's layout is being used.
*/
#ifdef VAR_PLAYGROUND
int len = strlen(VAR_PLAYGROUND);
@@ -481,9 +489,10 @@ boolean wr;
error("Cannot chdir to %s.", dir);
}
/* warn the player if we can't write the record file */
/* perhaps we should also test whether . is writable */
/* unfortunately the access system-call is worthless */
/* warn the player if we can't write the record file
* perhaps we should also test whether . is writable
* unfortunately the access system-call is worthless.
*/
if (wr) {
#ifdef VAR_PLAYGROUND
fqn_prefix[LEVELPREFIX] = fqn_prefix[SCOREPREFIX];
@@ -574,6 +583,7 @@ boolean
authorize_wizard_mode()
{
struct passwd *pw = get_unix_pw();
if (pw && sysopt.wizards && sysopt.wizards[0]) {
if (check_user_string(sysopt.wizards))
return TRUE;
@@ -626,6 +636,7 @@ char *optstr;
int pwlen;
char *eop, *w;
char *pwname;
if (optstr[0] == '*')
return TRUE; /* allow any user */
if (!pw)

View File

@@ -33,7 +33,7 @@ uid_t *ruid, *euid, *suid;
if (!f)
return -1;
return f(ruid, euid, suid);
return (*f)(ruid, euid, suid);
}
static int
@@ -46,7 +46,7 @@ gid_t *rgid, *egid, *sgid;
if (!f)
return -1;
return f(rgid, egid, sgid);
return (*f)(rgid, egid, sgid);
}
#else
@@ -74,6 +74,7 @@ uid_t *ruid, *euid, *suid;
int retval;
int pfd[2];
struct stat st;
if (pipe(pfd))
return -1;
retval = fstat(pfd[0], &st);
@@ -107,6 +108,7 @@ gid_t *rgid, *egid, *sgid;
int retval;
int pfd[2];
struct stat st;
if (pipe(pfd))
return -1;
retval = fstat(pfd[0], &st);
@@ -146,6 +148,7 @@ nh_getresuid(ruid, euid, suid)
uid_t *ruid, *euid, *suid;
{
int retval = real_getresuid(ruid, euid, suid);
if (!retval && hiding_privileges)
*euid = *suid = *ruid;
return retval;
@@ -155,6 +158,7 @@ uid_t
nh_getuid()
{
uid_t ruid, euid, suid;
(void) real_getresuid(&ruid, &euid, &suid);
return ruid;
}
@@ -163,6 +167,7 @@ uid_t
nh_geteuid()
{
uid_t ruid, euid, suid;
(void) real_getresuid(&ruid, &euid, &suid);
if (hiding_privileges)
euid = ruid;
@@ -174,6 +179,7 @@ nh_getresgid(rgid, egid, sgid)
gid_t *rgid, *egid, *sgid;
{
int retval = real_getresgid(rgid, egid, sgid);
if (!retval && hiding_privileges)
*egid = *sgid = *rgid;
return retval;
@@ -183,6 +189,7 @@ gid_t
nh_getgid()
{
gid_t rgid, egid, sgid;
(void) real_getresgid(&rgid, &egid, &sgid);
return rgid;
}
@@ -191,6 +198,7 @@ gid_t
nh_getegid()
{
gid_t rgid, egid, sgid;
(void) real_getresgid(&rgid, &egid, &sgid);
if (hiding_privileges)
egid = rgid;

View File

@@ -28,7 +28,8 @@ extern int errno;
static struct stat buf;
/* see whether we should throw away this xlock file */
/* see whether we should throw away this xlock file;
if yes, close it, otherwise leave it open */
static int
veryold(fd)
int fd;
@@ -36,10 +37,10 @@ int fd;
time_t date;
if (fstat(fd, &buf))
return (0); /* cannot get status */
return 0; /* cannot get status */
#ifndef INSURANCE
if (buf.st_size != sizeof(int))
return (0); /* not an xlock file */
if (buf.st_size != sizeof (int))
return 0; /* not an xlock file */
#endif
#if defined(BSD) && !defined(POSIX_TYPES)
(void) time((long *) (&date));
@@ -49,10 +50,10 @@ int fd;
if (date - buf.st_mtime < 3L * 24L * 60L * 60L) { /* recent */
int lockedpid; /* should be the same size as hackpid */
if (read(fd, (genericptr_t) &lockedpid, sizeof(lockedpid))
!= sizeof(lockedpid))
if (read(fd, (genericptr_t) &lockedpid, sizeof lockedpid)
!= sizeof lockedpid)
/* strange ... */
return (0);
return 0;
/* From: Rick Adams <seismo!rick> */
/* This will work on 4.1cbsd, 4.2bsd and system 3? & 5. */
@@ -62,10 +63,10 @@ int fd;
by more than one machine! -pem */
if (!(kill(lockedpid, 0) == -1 && errno == ESRCH))
#endif
return (0);
return 0;
}
(void) close(fd);
return (1);
return 1;
}
static int
@@ -85,8 +86,8 @@ eraseoldlocks()
}
set_levelfile_name(lock, 0);
if (unlink(fqname(lock, LEVELPREFIX, 0)))
return (0); /* cannot remove it */
return (1); /* success! */
return 0; /* cannot remove it */
return 1; /* success! */
}
void
@@ -139,8 +140,8 @@ getlock()
error("Cannot open %s", fq_lock);
}
if (veryold(fd) /* closes fd if true */
&& eraseoldlocks())
/* veryold() closes fd if true */
if (veryold(fd) && eraseoldlocks())
goto gotlock;
(void) close(fd);
} while (i < locknum);
@@ -157,17 +158,20 @@ getlock()
error("Cannot open %s", fq_lock);
}
if (veryold(fd) /* closes fd if true */ && eraseoldlocks())
/* veryold() closes fd if true */
if (veryold(fd) && eraseoldlocks())
goto gotlock;
(void) close(fd);
{
const char destroy_old_game_prompt[] =
"There is already a game in progress under your name. Destroy old game?";
if (iflags.window_inited) {
c = yn("There is already a game in progress under your name. "
"Destroy old game?");
/* this is a candidate for paranoid_confirmation */
c = yn(destroy_old_game_prompt);
} else {
(void) printf(
"\nThere is already a game in progress under your name.");
(void) printf(" Destroy old game? [yn] ");
(void) printf("\n%s [yn] ", destroy_old_game_prompt);
(void) fflush(stdout);
if ((c = getchar()) != EOF) {
int tmp;
@@ -178,10 +182,11 @@ getlock()
; /* eat rest of line and newline */
}
}
}
if (c == 'y' || c == 'Y') {
if (eraseoldlocks())
if (eraseoldlocks()) {
goto gotlock;
else {
} else {
unlock_file(HLOCK);
error("Couldn't destroy old game.");
}
@@ -197,8 +202,8 @@ gotlock:
if (fd == -1) {
error("cannot creat lock file (%s).", fq_lock);
} else {
if (write(fd, (genericptr_t) &hackpid, sizeof(hackpid))
!= sizeof(hackpid)) {
if (write(fd, (genericptr_t) &hackpid, sizeof hackpid)
!= sizeof hackpid) {
error("cannot write lock (%s)", fq_lock);
}
if (close(fd) == -1) {
@@ -207,13 +212,15 @@ gotlock:
}
}
void regularize(s) /* normalize file name - we don't like .'s, /'s, spaces */
/* normalize file name - we don't like .'s, /'s, spaces */
void
regularize(s)
register char *s;
{
register char *lp;
while ((lp = index(s, '.')) || (lp = index(s, '/'))
|| (lp = index(s, ' ')))
while ((lp = index(s, '.')) != 0 || (lp = index(s, '/')) != 0
|| (lp = index(s, ' ')) != 0)
*lp = '_';
#if defined(SYSV) && !defined(AIX_31) && !defined(SVR4) && !defined(LINUX) \
&& !defined(__APPLE__)
@@ -258,10 +265,13 @@ unsigned msec; /* milliseconds */
int
dosh()
{
register char *str;
char *str;
#ifdef SYSCF
if (!sysopt.shellers || !sysopt.shellers[0]
|| !check_user_string(sysopt.shellers)) {
/* FIXME: should no longer assume a particular command keystroke,
and perhaps ought to say "unavailable" rather than "unknown" */
Norep("Unknown command '!'.");
return 0;
}
@@ -284,6 +294,7 @@ child(wt)
int wt;
{
register int f;
suspend_nhwindows((char *) 0); /* also calls end_screen() */
#ifdef _M_UNIX
sco_mapon();
@@ -297,13 +308,13 @@ int wt;
#ifdef CHDIR
(void) chdir(getenv("HOME"));
#endif
return (1);
return 1;
}
if (f == -1) { /* cannot fork */
pline("Fork failed. Try again.");
return (0);
return 0;
}
/* fork succeeded; wait for child to exit */
/* fork succeeded; wait for child to exit */
#ifndef NO_SIGNAL
(void) signal(SIGINT, SIG_IGN);
(void) signal(SIGQUIT, SIG_IGN);
@@ -325,9 +336,9 @@ int wt;
wait_synch();
}
resume_nhwindows();
return (0);
return 0;
}
#endif
#endif /* SHELL || DEF_PAGER || DEF_MAILREADER */
#ifdef GETRES_SUPPORT
@@ -338,34 +349,37 @@ extern int FDECL(nh_getresgid, (gid_t *, gid_t *, gid_t *));
extern gid_t NDECL(nh_getgid);
extern gid_t NDECL(nh_getegid);
int(getresuid)(ruid, euid, suid)
/* the following several functions assume __STDC__ where parentheses
around the name of a function-like macro prevent macro expansion */
int (getresuid)(ruid, euid, suid)
uid_t *ruid, *euid, *suid;
{
return nh_getresuid(ruid, euid, suid);
}
uid_t(getuid)()
uid_t (getuid)()
{
return nh_getuid();
}
uid_t(geteuid)()
uid_t (geteuid)()
{
return nh_geteuid();
}
int(getresgid)(rgid, egid, sgid)
int (getresgid)(rgid, egid, sgid)
gid_t *rgid, *egid, *sgid;
{
return nh_getresgid(rgid, egid, sgid);
}
gid_t(getgid)()
gid_t (getgid)()
{
return nh_getgid();
}
gid_t(getegid)()
gid_t (getegid)()
{
return nh_getegid();
}
@@ -375,12 +389,15 @@ gid_t(getegid)()
/* XXX should be ifdef PANICTRACE_GDB, but there's no such symbol yet */
#ifdef PANICTRACE
boolean
file_exists(const char *path)
file_exists(path)
const char *path;
{
struct stat sb;
/* Just see if it's there - trying to figure out if we can actually
* execute it in all cases is too hard - we really just want to
* catch typos in SYSCF. */
struct stat sb;
* catch typos in SYSCF.
*/
if (stat(path, &sb)) {
return FALSE;
}

View File

@@ -53,6 +53,14 @@
# Maximum number of score file entries to use for random statue names
#MAX_STATUENAME_RANK=10
# Number of bones file pools.
# The pool you belong to is determined at game start. You will
# load and save bones only from that pool. Generally useful
# for public servers only.
# Changing this might make existing bones inaccessible.
# Disabled by setting to 0, or commenting out.
#BONES_POOLS=10
# Show debugging information originating from these source files.
# Use '*' for all, or list source files separated by spaces.
# Only available if game has been compiled with DEBUG, and can be

View File

@@ -487,7 +487,7 @@ MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
hangup(1);
#else
dosave0();
terminate(EXIT_SUCCESS);
nh_terminate(EXIT_SUCCESS);
#endif
}
return 0;
@@ -503,7 +503,7 @@ MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
free((PNHMainWindow) GetWindowLong(hWnd, GWL_USERDATA));
SetWindowLong(hWnd, GWL_USERDATA, (LONG) 0);
terminate(EXIT_SUCCESS);
nh_terminate(EXIT_SUCCESS);
} break;
/*-----------------------------------------------------------------------*/

View File

@@ -680,7 +680,7 @@ mswin_exit_nhwindows(const char *str)
// Don't do any of this (?) - exit_nhwindows does not terminate
// the application
// DestroyWindow(GetNHApp()->hMainWnd);
// terminate(EXIT_SUCCESS);
// nh_terminate(EXIT_SUCCESS);
}
/* Prepare the window to be suspended. */
@@ -1726,7 +1726,7 @@ bail(const char *mesg)
{
clearlocks();
mswin_exit_nhwindows(mesg);
terminate(EXIT_SUCCESS);
nh_terminate(EXIT_SUCCESS);
/*NOTREACHED*/
}

View File

@@ -21,10 +21,18 @@ tty and graphical win32 versions of NetHack 3.6.1.
You can build a TTY version of NetHack and a Windows Graphical
version. You can use one of the following build environments:
o A copy of Microsoft Visual Studio 2017 Express
OR
o A copy of Microsoft Visual Studio 2015 Express
OR
o A copy of Microsoft Visual Studio 2013 Express
The current NetHack code has not been tested with earlier versions
of the compiler.
OR
o A copy of MinGW. MinGW is a collection of header
@@ -34,12 +42,44 @@ version. You can use one of the following build environments:
http://www.mingw.org/
Earlier versions of MinGW will not allow you to build the Windows
Graphical version.
In addition to the makefiles that allow you to build NetHack from the
command line, there is also a set of project files and a workspace file
that allow you to build the Windows Graphical version from Microsoft
Visual C's IDE (Integrated Development Environment.)
/--------------------------------------------------------\
| Building And Running Using Visual Studio 2015 or |
| Visual Studio 2017 |
\--------------------------------------------------------/
If you are NOT using Visual Studio 2015 or Visual Studio 2017, proceed
to "FIRST STEP - MOVING THINGS AROUND".
When using either Visual Studio 2015 or Visual Studio 2017, you do not
need to move things around. You simply need to load the solution file
within the IDE, build the solution and run the version of NetHack
you wish to run.
The Visual Studio 2015 NetHack solution file can be found here:
win\win32\vs2015\NetHack.sln
The Visual Studio 2017 NetHack solution file can be found here:
win\win32\vs2017\NetHack.sln
So the steps are:
1. Launch the IDE.
2. Open the appropriate solution file.
3. Select the build configuration you wish to use.
4. From build menu, select build solution.
5. Type F5 to start debugging.
You can also build all the projects for all platforms and configurations
using a "build.bat" batch file found in the same directory as the solution.
Change to the appropriate directory (i.e. win\win32\vs2015 for VS2015 builds)
and run "build.bat".
/-----------------------------------\
| FIRST STEP - MOVING THINGS AROUND |
@@ -49,11 +89,11 @@ The first step in building either version of NetHack is to execute
sys\winnt\nhsetup.bat to move some files to their required locations.
From the command prompt:
cd sys\winnt
nhsetup
cd sys\winnt
nhsetup
From a Windows explorer window:
double-click on nhsetup.bat
double-click on nhsetup.bat
A "binary" directory will be created off the top of the NetHack source
tree to house the completed build.

View File

@@ -44,6 +44,28 @@ OPTIONS=symset:IBMGraphics_2,roguesymset:RogueEpyx
#OPTIONS=hilite_status:hitpoints/30%/bright-magenta/normal
#OPTIONS=perm_invent
# Highlight menu lines with different colors. You need to define the colors
# with MENUCOLOR lines.
# Toggle menucolor use on or off
OPTIONS=menucolors
# Define color used for a certain menu line. Format is
# MENUCOLOR="regular expression"=color
# or
# MENUCOLOR="regular expression"=color&attribute
# Show all blessed items in green
MENUCOLOR=" blessed " = green
# Show all holy water in green
MENUCOLOR=" holy " = green
# Show all cursed items in red
MENUCOLOR=" cursed " = red
# Show all unholy water in red
MENUCOLOR=" unholy " = red
# Show all cursed worn items in orange and underlined
MENUCOLOR=" cursed .* (being worn)" = orange&underline
# Turn off all status hilites.
#OPTIONS=!statushilites
#
@@ -54,6 +76,9 @@ OPTIONS=symset:IBMGraphics_2,roguesymset:RogueEpyx
# or 2(on,legacy-mode) which causes 5='g', alt-5='G', alt-0='I'
OPTIONS=time,noshowexp,number_pad:2,lit_corridor
# Make commands that ask for an inventory item pop up a menu
OPTIONS=force_invmenu
#
# If you want to get rid of "use #quit to quit..." use:
OPTIONS=suppress_alert:3.3.1

View File

@@ -10,7 +10,38 @@ set BUILDPATH=..\..\build
set BINPATH=..\..\binary
set VCDir=
:studiocheck
goto :main
:dirname
rem Get the dirname of the second argument and set the variable who's
rem name was specified in the first argument.
call set %~1=%%~dp2
call set %~1=%%%~1:~0,-1%%
goto :EOF
:main
:vscheck2015
rem cannot use the registry trick as in vc2010
rem 14 = 2015
SET VCVERS=14
rem Finally, let's determine the root folder for this VC installation.
call set VCROOT=%%VS%VCVERS%0COMNTOOLS%%
if "%VCROOT:~-1%"=="\" set VCROOT=%VCROOT:~0,-1%
rem VCROOT=VSDir\Common7\Tools
call :dirname VCROOT "%VCROOT%"
rem VCROOT=VSDir\Common7
call :dirname VCROOT "%VCROOT%"
rem VCROOT=VSDir
set VCDir=%VCROOT%\VC
SET MSVCVERSION=2015
if not defined VCDir goto :studiocheck2010
if not exist "%VCDir%" goto :studiocheck2010
goto :fallback
:studiocheck2010
@REM Set fallbacks here for 32-bit VS2010
SET REGTREE=HKLM\Software\Microsoft\VCExpress\12.0\Setup\VC
SET MSVCVERSION=2010

View File

@@ -32,6 +32,14 @@ WIZARDS=*
# %N first character of player name
#DUMPLOGFILE=nethack-%n-%d.log
# Number of bones file pools.
# The pool you belong to is determined at game start. You will
# load and save bones only from that pool. Generally useful
# for public servers only.
# Changing this might make existing bones inaccessible.
# Disabled by setting to 0, or commenting out.
#BONES_POOLS=10
# Limit the number of simultaneous games (see also nethack.sh).
#MAXPLAYERS=10

View File

@@ -17,6 +17,13 @@
#define WIN32_LEAN_AND_MEAN
#undef Protection /* We have a global name space collision. No source file
using win32api.h should be using the Protection macro
from youprop.h.
A better fix would be to ensure we include all window
header files before we start clobbering the global name
space with NetHack specific macros. */
#include <windows.h>
#include <commctrl.h>