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

This commit is contained in:
keni
2016-12-26 18:43:18 -05:00
7 changed files with 38 additions and 34 deletions

View File

@@ -14,12 +14,12 @@
is reporting the wrong character but will be operating correctly if
it describes ^J when you type ^M.
A NUL character, typed as ^<space> on some keyboards, ^@ on others,
and maybe not typeable at all on yet others. It is not used as a
command, and will be converted into ESC before reaching 'whatdoes'.
Unlike ^M, this transformation is performed by NetHack itself.
But like ^M, if you type NUL and get feedback about ESC, the
situation is expected.
A NUL character, which is typed as ^<space> on some keyboards,
^@ on others, and maybe not typeable at all on yet others, is not
used as a command, and will be converted into ESC before reaching
'whatdoes'. Unlike ^M, this transformation is performed within
NetHack. But like ^M, if you type NUL and get feedback about ESC,
the situation is expected.
ESC itself is a synonym for ^[, and is another source of oddity.
Various function keys, including cursor arrow keys, may transmit

View File

@@ -920,6 +920,7 @@ wiz_map_levltyp(VOID_ARGS)
? 'a' + terrain - 10
: 'A' + terrain - 36);
}
x--;
if (levl[0][y].typ != STONE || may_dig(0, y))
row[x++] = '!';
row[x] = '\0';

View File

@@ -1484,6 +1484,10 @@ int
cursed(otmp)
register struct obj *otmp;
{
if (!otmp) {
impossible("cursed without otmp");
return 0;
}
/* Curses, like chickens, come home to roost. */
if ((otmp == uwep) ? welded(otmp) : (int) otmp->cursed) {
boolean use_plural = (is_boots(otmp) || is_gloves(otmp)

View File

@@ -2839,11 +2839,12 @@ struct obj *no_wish;
*/
if (!strstri(bp, "wand ") && !strstri(bp, "spellbook ")
&& !strstri(bp, "finger ")) {
if (((p = strstri(bp, "tin of ")) != 0)
&& (tmp = tin_variety_txt(p + 7, &tinv))
&& (mntmp = name_to_mon(p + 7 + tmp)) >= LOW_PM) {
*(p + 3) = 0;
if ((p = strstri(bp, "tin of ")) != 0) {
tmp = tin_variety_txt(p + 7, &tinv);
tvariety = tinv;
mntmp = name_to_mon(p + 7 + tmp);
typ = TIN;
goto typfnd;
} else if ((p = strstri(bp, " of ")) != 0
&& (mntmp = name_to_mon(p + 4)) >= LOW_PM)
*p = 0;

View File

@@ -4,8 +4,6 @@
HACKDIR=/usr/games/lib/nethackdir
export HACKDIR
HACK=$HACKDIR/nethack
# NB: MAXNROFPLAYERS is deprecated in favor of MAXPLAYERS in SYSCF.
MAXNROFPLAYERS=4
# Since Nethack.ad is installed in HACKDIR, add it to XUSERFILESEARCHPATH
case "x$XUSERFILESEARCHPATH" in
@@ -65,11 +63,4 @@ fi
cd $HACKDIR
case $1 in
-s*)
exec $HACK "$@"
;;
*)
exec $HACK "$@" $MAXNROFPLAYERS
;;
esac
exec $HACK "$@"

View File

@@ -419,10 +419,14 @@ char *argv[];
}
}
/* XXX This is deprecated in favor of SYSCF with MAXPLAYERS. Make
* an error in next release. */
#ifdef SYSCF
if (argc > 1)
raw_printf("MAXPLAYERS are set in sysconf file.\n");
#else
/* XXX This is deprecated in favor of SYSCF with MAXPLAYERS */
if (argc > 1)
locknum = atoi(argv[1]);
#endif
#ifdef MAX_NR_OF_PLAYERS
/* limit to compile-time limit */
if (!locknum || locknum > MAX_NR_OF_PLAYERS)

View File

@@ -2448,19 +2448,22 @@ const char *str;
topline wrapping converts space at wrap point into newline,
we reverse that here */
if ((int) strlen(str) >= CO || index(str, '\n')) {
register const char *bp0 = str;
char c, nxtc, *bp1 = cbuf, *endbp1 = &cbuf[sizeof cbuf - 1];
const char *in_str = str;
char c, *outstr = cbuf, *outend = &cbuf[sizeof cbuf - 1];
boolean was_space = TRUE; /* True discards all leading spaces;
False would retain one if present */
cbuf[0] = cbuf[sizeof cbuf - 1] = '\0'; /* superfluous */
nxtc = (*bp0 == '\n') ? ' ' : *bp0;
do {
c = nxtc;
nxtc = bp0[1];
if (nxtc == '\n')
nxtc = ' ';
if (c != ' ' || nxtc != ' ')
*bp1++ = c;
} while (*bp0++ && bp1 < endbp1);
while ((c = *in_str++) != '\0' && outstr < outend) {
if (c == '\n')
c = ' ';
if (was_space && c == ' ')
continue;
*outstr++ = c;
was_space = (c == ' ');
}
if ((was_space && outstr > cbuf) || outstr == outend)
--outstr; /* remove trailing space or make room for terminator */
*outstr = '\0';
str = cbuf;
}
return str;