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 is reporting the wrong character but will be operating correctly if
it describes ^J when you type ^M. it describes ^J when you type ^M.
A NUL character, typed as ^<space> on some keyboards, ^@ on others, A NUL character, which is typed as ^<space> on some keyboards,
and maybe not typeable at all on yet others. It is not used as a ^@ on others, and maybe not typeable at all on yet others, is not
command, and will be converted into ESC before reaching 'whatdoes'. used as a command, and will be converted into ESC before reaching
Unlike ^M, this transformation is performed by NetHack itself. 'whatdoes'. Unlike ^M, this transformation is performed within
But like ^M, if you type NUL and get feedback about ESC, the NetHack. But like ^M, if you type NUL and get feedback about ESC,
situation is expected. the situation is expected.
ESC itself is a synonym for ^[, and is another source of oddity. ESC itself is a synonym for ^[, and is another source of oddity.
Various function keys, including cursor arrow keys, may transmit 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 - 10
: 'A' + terrain - 36); : 'A' + terrain - 36);
} }
x--;
if (levl[0][y].typ != STONE || may_dig(0, y)) if (levl[0][y].typ != STONE || may_dig(0, y))
row[x++] = '!'; row[x++] = '!';
row[x] = '\0'; row[x] = '\0';

View File

@@ -1484,6 +1484,10 @@ int
cursed(otmp) cursed(otmp)
register struct obj *otmp; register struct obj *otmp;
{ {
if (!otmp) {
impossible("cursed without otmp");
return 0;
}
/* Curses, like chickens, come home to roost. */ /* Curses, like chickens, come home to roost. */
if ((otmp == uwep) ? welded(otmp) : (int) otmp->cursed) { if ((otmp == uwep) ? welded(otmp) : (int) otmp->cursed) {
boolean use_plural = (is_boots(otmp) || is_gloves(otmp) 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 ") if (!strstri(bp, "wand ") && !strstri(bp, "spellbook ")
&& !strstri(bp, "finger ")) { && !strstri(bp, "finger ")) {
if (((p = strstri(bp, "tin of ")) != 0) if ((p = strstri(bp, "tin of ")) != 0) {
&& (tmp = tin_variety_txt(p + 7, &tinv)) tmp = tin_variety_txt(p + 7, &tinv);
&& (mntmp = name_to_mon(p + 7 + tmp)) >= LOW_PM) {
*(p + 3) = 0;
tvariety = tinv; tvariety = tinv;
mntmp = name_to_mon(p + 7 + tmp);
typ = TIN;
goto typfnd;
} else if ((p = strstri(bp, " of ")) != 0 } else if ((p = strstri(bp, " of ")) != 0
&& (mntmp = name_to_mon(p + 4)) >= LOW_PM) && (mntmp = name_to_mon(p + 4)) >= LOW_PM)
*p = 0; *p = 0;

View File

@@ -4,8 +4,6 @@
HACKDIR=/usr/games/lib/nethackdir HACKDIR=/usr/games/lib/nethackdir
export HACKDIR export HACKDIR
HACK=$HACKDIR/nethack 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 # Since Nethack.ad is installed in HACKDIR, add it to XUSERFILESEARCHPATH
case "x$XUSERFILESEARCHPATH" in case "x$XUSERFILESEARCHPATH" in
@@ -65,11 +63,4 @@ fi
cd $HACKDIR cd $HACKDIR
case $1 in exec $HACK "$@"
-s*)
exec $HACK "$@"
;;
*)
exec $HACK "$@" $MAXNROFPLAYERS
;;
esac

View File

@@ -419,10 +419,14 @@ char *argv[];
} }
} }
/* XXX This is deprecated in favor of SYSCF with MAXPLAYERS. Make #ifdef SYSCF
* an error in next release. */ 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) if (argc > 1)
locknum = atoi(argv[1]); locknum = atoi(argv[1]);
#endif
#ifdef MAX_NR_OF_PLAYERS #ifdef MAX_NR_OF_PLAYERS
/* limit to compile-time limit */ /* limit to compile-time limit */
if (!locknum || locknum > MAX_NR_OF_PLAYERS) 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, topline wrapping converts space at wrap point into newline,
we reverse that here */ we reverse that here */
if ((int) strlen(str) >= CO || index(str, '\n')) { if ((int) strlen(str) >= CO || index(str, '\n')) {
register const char *bp0 = str; const char *in_str = str;
char c, nxtc, *bp1 = cbuf, *endbp1 = &cbuf[sizeof cbuf - 1]; 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 */ while ((c = *in_str++) != '\0' && outstr < outend) {
nxtc = (*bp0 == '\n') ? ' ' : *bp0; if (c == '\n')
do { c = ' ';
c = nxtc; if (was_space && c == ' ')
nxtc = bp0[1]; continue;
if (nxtc == '\n') *outstr++ = c;
nxtc = ' '; was_space = (c == ' ');
if (c != ' ' || nxtc != ' ') }
*bp1++ = c; if ((was_space && outstr > cbuf) || outstr == outend)
} while (*bp0++ && bp1 < endbp1); --outstr; /* remove trailing space or make room for terminator */
*outstr = '\0';
str = cbuf; str = cbuf;
} }
return str; return str;