Merge branch 'master' into win32-x64-working

Conflicts:
	include/extern.h
This commit is contained in:
nhmall
2015-04-12 00:35:57 -04:00
6 changed files with 69 additions and 22 deletions

View File

@@ -6,7 +6,7 @@
.ds vr "NetHack 3.6
.ds f0 "\*(vr
.ds f1
.ds f2 "March 27, 2015
.ds f2 "April 12, 2015
.\" labeled paragraph start (should be part of tmac.n, but I don't want to
.\" make changes to that file)
.\" .PS word
@@ -3314,7 +3314,7 @@ various Unix flavors as well as maintaining the X11 interface.
maintained the port of NetHack 3.6.0 for Mac.
.pg
\fBMichael Allison\fP, \fBDerek S. Ray\fP, \fBYitzhak Sapir\fP,
\fBAlex Kompel\fP, and \fBDavid Cohrs\fP maintained the port of
\fBAlex Kompel\fP, and \fBDion Nicolaas\fP maintained the port of
NetHack 3.6.0 for Microsoft Windows.
.pg
\fBJeff Bailey\fP created and maintained a port of NetHack 3.6.0 for Chrome.

View File

@@ -33,7 +33,7 @@
\begin{document}
%
% input file: guidebook.mn
% $Revision: 1.122 $ $Date: 2015/03/27 06:00:00 $
% $Revision: 1.122 $ $Date: 2015/04/12 06:00:00 $
%
%.ds h0 "
%.ds h1 %.ds h2 \%
@@ -46,7 +46,7 @@
%.au
\author{Eric S. Raymond\\
(Edited and expanded for 3.6)}
\date{March 27, 2015}
\date{April 12, 2015}
\maketitle
@@ -3997,7 +3997,7 @@ maintained the port of NetHack 3.6.0 for Mac.
%.pg
\medskip
{\it Michael Allison}, {\it Derek S. Ray}, {\it Yitzhak Sapir},
{\it Alex Kompel}, and {\it David Cohrs} maintained the port of
{\it Alex Kompel}, and {\it Dion Nicolaas} maintained the port of
NetHack 3.6.0 for Microsoft Windows.
%.pg

View File

@@ -896,6 +896,7 @@ allow showing legal positions for stinking cloud, jumping and polearms
when asked for a location
cloned creatures (of any type) don't deathdrop items
pudding corpses behave somewhat differently than before
mithril armor should have silver color
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 extern.h $NHDT-Date: 1428715841 2015/04/11 01:30:41 $ $NHDT-Branch: master $:$NHDT-Revision: 1.454 $ */
/* NetHack 3.5 extern.h $NHDT-Date: 1428806395 2015/04/12 02:39:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.455 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -832,6 +832,8 @@ E int FDECL(isqrt, (int));
E int FDECL(distmin, (int,int,int,int));
E boolean FDECL(online2, (int,int,int,int));
E boolean FDECL(pmatch, (const char *,const char *));
E boolean FDECL(pmatchi, (const char *,const char *));
E boolean FDECL(pmatchz, (const char *,const char *));
#ifndef STRNCMPI
E int FDECL(strncmpi, (const char *,const char *,int));
#endif

View File

@@ -1,15 +1,15 @@
/* NetHack 3.5 hacklib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 hacklib.c $NHDT-Date: 1428806394 2015/04/12 02:39:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.34 $ */
/* NetHack 3.5 hacklib.c $Date: 2009/05/06 10:46:32 $ $Revision: 1.23 $ */
/* SCCS Id: @(#)hacklib.c 3.5 2007/04/30 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* Copyright (c) Robert Patrick Rankin, 1991 */
/* NetHack may be freely redistributed. See license for details. */
/* We could include only config.h, except for the overlay definitions... */
#include "hack.h"
#include "hack.h" /* for config.h+extern.h */
/*=
Assorted 'small' utility routines. They're virtually independent of
NetHack, except that rounddiv may call panic().
NetHack, except that rounddiv may call panic(). setrandom calls one of
srandom(), srand48(), or srand() depending upon configuration.
return type routine name argument type(s)
boolean digit (char)
@@ -40,9 +40,12 @@ NetHack, except that rounddiv may call panic().
int dist2 (int, int, int, int)
boolean online2 (int, int)
boolean pmatch (const char *, const char *)
boolean pmatchi (const char *, const char *)
boolean pmatchz (const char *, const char *)
int strncmpi (const char *, const char *, int)
char * strstri (const char *, const char *)
boolean fuzzymatch (const char *,const char *,const char *,boolean)
boolean fuzzymatch (const char *,const char *,
const char *,boolean)
void setrandom (void)
time_t getnow (void)
int getyear (void)
@@ -62,6 +65,9 @@ NetHack, except that rounddiv may call panic().
# define Static static
#endif
static boolean FDECL(pmatch_internal, (const char *,const char *,
BOOLEAN_P,const char *));
boolean
digit(c) /* is 'c' a digit? */
char c;
@@ -465,9 +471,12 @@ online2(x0, y0, x1, y1) /* are two points lined up (on a straight line)? */
return((boolean)(!dy || !dx || (dy == dx) || (dy + dx == 0))); /* (dy == -dx) */
}
boolean
pmatch(patrn, strng) /* match a string against a pattern */
/* guts of pmatch(), pmatchi(), and pmatchz() */
static boolean
pmatch_internal(patrn, strng, ci, sk) /* match a string against a pattern */
const char *patrn, *strng;
boolean ci; /* True => case-insensitive, False => case-sensitive */
const char *sk; /* set of characters to skip */
{
char s, p;
/*
@@ -475,18 +484,53 @@ pmatch(patrn, strng) /* match a string against a pattern */
: any single character. Returns TRUE if 'strng' matches 'patrn'.
*/
pmatch_top:
s = *strng++; p = *patrn++; /* get next chars and pre-advance */
if (!sk) {
s = *strng++; p = *patrn++; /* get next chars and pre-advance */
} else {
/* fuzzy match variant of pmatch; particular characters are ignored */
do { s = *strng++; } while (index(sk, s));
do { p = *patrn++; } while (index(sk, p));
}
if (!p) /* end of pattern */
return((boolean)(s == '\0')); /* matches iff end of string too */
return (boolean)(s == '\0'); /* matches iff end of string too */
else if (p == '*') /* wildcard reached */
return((boolean)((!*patrn || pmatch(patrn, strng-1)) ? TRUE :
s ? pmatch(patrn-1, strng) : FALSE));
else if (p != s && (p != '?' || !s)) /* check single character */
return (boolean)
((!*patrn || pmatch_internal(patrn, strng-1, ci, sk)) ? TRUE :
s ? pmatch_internal(patrn-1, strng, ci, sk) : FALSE);
else if ((ci ? lowc(p) != lowc(s) : p != s) /* check single character */
&& (p != '?' || !s)) /* & single-char wildcard */
return FALSE; /* doesn't match */
else /* return pmatch(patrn, strng); */
else /* return pmatch_internal(patrn, strng, ci, sk); */
goto pmatch_top; /* optimize tail recursion */
}
/* case-sensitive wildcard match */
boolean
pmatch(patrn, strng)
const char *patrn, *strng;
{
return pmatch_internal(patrn, strng, FALSE, (const char *)0);
}
/* case-insensitive wildcard match */
boolean
pmatchi(patrn, strng)
const char *patrn, *strng;
{
return pmatch_internal(patrn, strng, TRUE, (const char *)0);
}
/* case-insensitive wildcard fuzzymatch */
boolean
pmatchz(patrn, strng)
const char *patrn, *strng;
{
/* ignore spaces, tabs (just in case), dashes, and underscores */
static const char fuzzychars[] = " \t-_";
return pmatch_internal(patrn, strng, TRUE, fuzzychars);
}
#ifndef STRNCMPI
int
strncmpi(s1, s2, n) /* case insensitive counted string comparison */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 objects.c $NHDT-Date: 1426470348 2015/03/16 01:45:48 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.27 $ */
/* NetHack 3.5 objects.c $NHDT-Date: 1428802519 2015/04/12 01:35:19 $ $NHDT-Branch: master $:$NHDT-Revision: 1.34 $ */
/* Copyright (c) Mike Threepoint, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -373,9 +373,9 @@ ARMOR("splint mail", (char *)0,
ARMOR("banded mail", (char *)0,
1, 0, 1, 0, 72, 5, 350, 90, 4, 1, ARM_SUIT, IRON, HI_METAL),
ARMOR("dwarvish mithril-coat", (char *)0,
1, 0, 0, 0, 10, 1, 150, 240, 4, 2, ARM_SUIT, MITHRIL, HI_METAL),
1, 0, 0, 0, 10, 1, 150, 240, 4, 2, ARM_SUIT, MITHRIL, HI_SILVER),
ARMOR("elven mithril-coat", (char *)0,
1, 0, 0, 0, 15, 1, 150, 240, 5, 2, ARM_SUIT, MITHRIL, HI_METAL),
1, 0, 0, 0, 15, 1, 150, 240, 5, 2, ARM_SUIT, MITHRIL, HI_SILVER),
ARMOR("chain mail", (char *)0,
1, 0, 0, 0, 72, 5, 300, 75, 5, 1, ARM_SUIT, IRON, HI_METAL),
ARMOR("orcish chain mail", "crude chain mail",