Merge branch 'NetHack-3.7' into paxed-lua-v2-merged

This commit is contained in:
nhmall
2019-11-06 16:49:33 -05:00
4 changed files with 40 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.159 $ $NHDT-Date: 1572892926 2019/11/04 18:42:06 $
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.162 $ $NHDT-Date: 1573066356 2019/11/06 18:52:36 $
This fixes36.3 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.2 in May 2019. Please note, however,
@@ -217,6 +217,7 @@ some other deafness-related message corrections
when dipping into holy/unholy water while blind (where the glow message is
suppressed), clear dipped item's bknown flag unless water potion's
bless/curse state is known
playing music while hallucinating: message misspelled "butterflies"
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository
@@ -268,6 +269,7 @@ EDIT_GETLIN: using 'O' to set message types or menu colors was overloading the
during repeat prompting
EDIT_GETLIN: for paranoid confirmation, if answer was neither "yes" nor "no",
don't supply the rejected answer as the default when retrying
USE_FCNTL: nethack wasn't closing lock file 'perm'
curses: very tall menus tried to use selector characters a-z, A-Z, and 0-9,
but 0-9 should be reserved for counts and if the display was tall
enough for more than 62 entries, arbitrary ASCII punctuation got used

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 files.c $NHDT-Date: 1571347976 2019/10/17 21:32:56 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.254 $ */
/* NetHack 3.6 files.c $NHDT-Date: 1573066357 2019/11/06 18:52:37 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.260 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1875,7 +1875,7 @@ boolean uncomp;
/* ---------- BEGIN FILE LOCKING HANDLING ----------- */
#if defined(NO_FILE_LINKS) || defined(USE_FCNTL) /* implies UNIX */
static int lockfd; /* for lock_file() to pass to unlock_file() */
static int lockfd = -1; /* for lock_file() to pass to unlock_file() */
#endif
#ifdef USE_FCNTL
struct flock sflock; /* for unlocking, same as above */
@@ -1987,7 +1987,7 @@ int retryct;
return FALSE;
}
#else
register int errnosv = errno;
int errnosv = errno;
switch (errnosv) { /* George Barbanis */
case EEXIST:
@@ -2098,9 +2098,10 @@ const char *filename;
if (g.nesting == 1) {
#ifdef USE_FCNTL
sflock.l_type = F_UNLCK;
if (fcntl(lockfd, F_SETLK, &sflock) == -1) {
HUP raw_printf("Can't remove fcntl lock on %s.", filename);
(void) close(lockfd);
if (lockfd >= 0) {
if (fcntl(lockfd, F_SETLK, &sflock) == -1)
HUP raw_printf("Can't remove fcntl lock on %s.", filename);
(void) close(lockfd), lockfd = -1;
}
#else
lockname = make_lockname(filename, locknambuf);
@@ -2112,7 +2113,7 @@ const char *filename;
if (unlink(lockname) < 0)
HUP raw_printf("Can't unlink %s.", lockname);
#ifdef NO_FILE_LINKS
(void) nhclose(lockfd);
(void) nhclose(lockfd), lockfd = -1;
#endif
#endif /* UNIX || VMS */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 music.c $NHDT-Date: 1572833563 2019/11/04 02:12:43 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.58 $ */
/* NetHack 3.6 music.c $NHDT-Date: 1573063606 2019/11/06 18:06:46 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.60 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
@@ -481,24 +481,41 @@ struct obj *instr;
if (Hallucination)
mode |= PLAY_HALLU;
if (!rn2(2)) {
/*
* TEMPORARY? for multiple impairments, don't always
* give the generic "it's far from music" message.
*/
/* remove if STUNNED+CONFUSED ever gets its own message below */
if (mode == (PLAY_STUNNED | PLAY_CONFUSED))
mode = !rn2(2) ? PLAY_STUNNED : PLAY_CONFUSED;
/* likewise for stunned and/or confused combined with hallucination */
if (mode & PLAY_HALLU)
mode = PLAY_HALLU;
}
/* 3.6.3: most of these gave "You produce <blah>" and then many of
the instrument-specific messages below which immediately follow
also gave "You produce <something>." That looked strange so we
now use a different verb here */
switch (mode) {
case PLAY_NORMAL:
You("start playing %s.", yname(instr));
break;
case PLAY_STUNNED:
if (!Deaf)
You("produce an obnoxious droning sound.");
You("radiate an obnoxious droning sound.");
else
You_feel("a monotonous vibration.");
break;
case PLAY_CONFUSED:
if (!Deaf)
You("produce a raucous noise.");
You("generate a raucous noise.");
else
You_feel("a jarring vibration.");
break;
case PLAY_HALLU:
You("produce a kaleidoscopic display of floating butterfiles.");
You("disseminate a kaleidoscopic display of floating butterflies.");
break;
/* TODO? give some or all of these combinations their own feedback;
hallucination ones should reference senses other than hearing... */
@@ -507,7 +524,7 @@ struct obj *instr;
case PLAY_CONFUSED | PLAY_HALLU:
case PLAY_STUNNED | PLAY_CONFUSED | PLAY_HALLU:
default:
pline("What you produce is quite far from music...");
pline("What you perform is quite far from music...");
break;
}
#undef PLAY_NORMAL

View File

@@ -12,6 +12,9 @@
#include <sys\stat.h>
#include <errno.h>
#include <ShlObj.h>
#if !defined(VERSION_MAJOR)
#include "patchlevel.h"
#endif
#if !defined(SAFEPROCS)
#error You must #define SAFEPROCS to build windmain.c
@@ -101,7 +104,7 @@ build_known_folder_path(
get_known_folder_path(folder_id, path, path_size);
strcat(path, "\\NetHack\\");
create_directory(path);
strcat(path, "3.6\\");
Sprintf(eos(path), "%d.%d\\", VERSION_MAJOR, VERSION_MINOR);
create_directory(path);
}
@@ -195,6 +198,7 @@ set_default_prefix_locations(const char *programPath)
static char nethack_per_user_data_path[MAX_PATH];
static char nethack_global_data_path[MAX_PATH];
static char sysconf_path[MAX_PATH];
static char versioninfo[8];
strcpy(executable_path, get_executable_path());
append_slash(executable_path);
@@ -227,7 +231,8 @@ set_default_prefix_locations(const char *programPath)
g.fqn_prefix[HACKPREFIX] = hack_path;
g.fqn_prefix[TROUBLEPREFIX] = hack_path;
build_environment_path("COMMONPROGRAMFILES", "NetHack\\3.6", sysconf_path,
Sprintf(versioninfo, "NetHack\\%d.%d", VERSION_MAJOR, VERSION_MINOR);
build_environment_path("COMMONPROGRAMFILES", versioninfo, sysconf_path,
sizeof(sysconf_path));
if(!folder_file_exists(sysconf_path, SYSCF_FILE))