Merge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.0
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 lint.h $NHDT-Date: 1430897871 2015/05/06 07:37:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.0 $ */
|
||||
/* NetHack 3.6 lint.h $NHDT-Date: 1449269910 2015/12/04 22:58:30 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.3 $ */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/*
|
||||
@@ -36,19 +36,21 @@ extern unsigned nhUse_dummy;
|
||||
#ifdef DEBUG
|
||||
#define showdebug(file) debugcore(file, TRUE)
|
||||
#define explicitdebug(file) debugcore(file, FALSE)
|
||||
#define ifdebug(stmt) \
|
||||
do { \
|
||||
if (showdebug(__FILE__)) \
|
||||
stmt; \
|
||||
#define ifdebug(stmt) \
|
||||
do { \
|
||||
if (showdebug(__FILE__)) { \
|
||||
stmt; \
|
||||
} \
|
||||
} while (0)
|
||||
#ifdef _MSC_VER
|
||||
/* if we have microsoft's C runtime we can use these instead */
|
||||
#include <crtdbg.h>
|
||||
#define crtdebug(stmt) \
|
||||
do { \
|
||||
if (showdebug(__FILE__)) \
|
||||
stmt; \
|
||||
_RPT0(_CRT_WARN, "\n"); \
|
||||
#define crtdebug(stmt) \
|
||||
do { \
|
||||
if (showdebug(__FILE__)) { \
|
||||
stmt; \
|
||||
} \
|
||||
_RPT0(_CRT_WARN, "\n"); \
|
||||
} while (0)
|
||||
#define debugpline0(str) crtdebug(_RPT0(_CRT_WARN, str))
|
||||
#define debugpline1(fmt, arg) crtdebug(_RPT1(_CRT_WARN, fmt, arg))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 system.h $NHDT-Date: 1432512775 2015/05/25 00:12:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */
|
||||
/* NetHack 3.6 system.h $NHDT-Date: 1449269772 2015/12/04 22:56:12 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.12 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -514,8 +514,9 @@ E char *FDECL(tgetstr, (const char *, char **));
|
||||
E char *FDECL(tgoto, (const char *, int, int));
|
||||
#endif
|
||||
|
||||
#ifdef ALLOC_C
|
||||
#if defined(ALLOC_C) || defined(MAKEDEFS_C)
|
||||
E genericptr_t FDECL(malloc, (size_t));
|
||||
E genericptr_t FDECL(realloc, (genericptr_t, size_t));
|
||||
#endif
|
||||
|
||||
/* time functions */
|
||||
|
||||
10
src/attrib.c
10
src/attrib.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 attrib.c $NHDT-Date: 1446975460 2015/11/08 09:37:40 $ $NHDT-Branch: master $:$NHDT-Revision: 1.49 $ */
|
||||
/* NetHack 3.6 attrib.c $NHDT-Date: 1449269911 2015/12/04 22:58:31 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.51 $ */
|
||||
/* Copyright 1988, 1989, 1990, 1992, M. Stephenson */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -470,8 +470,9 @@ exerchk()
|
||||
/* Check out the periodic accumulations */
|
||||
exerper();
|
||||
|
||||
if (moves >= context.next_attrib_check)
|
||||
if (moves >= context.next_attrib_check) {
|
||||
debugpline1("exerchk: ready to test. multi = %d.", multi);
|
||||
}
|
||||
/* Are we ready for a test? */
|
||||
if (moves >= context.next_attrib_check && !multi) {
|
||||
debugpline0("exerchk: testing.");
|
||||
@@ -515,8 +516,9 @@ exerchk()
|
||||
? "Dex"
|
||||
: (i == A_CON)
|
||||
? "Con"
|
||||
: (i == A_CHA) ? "Cha?"
|
||||
: "???",
|
||||
: (i == A_CHA)
|
||||
? "Cha?"
|
||||
: "???",
|
||||
ax);
|
||||
/*
|
||||
* Law of diminishing returns (Part III):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 bones.c $NHDT-Date: 1446369463 2015/11/01 09:17:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.65 $ */
|
||||
/* NetHack 3.6 bones.c $NHDT-Date: 1449269914 2015/12/04 22:58:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.66 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985,1993. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -608,9 +608,10 @@ getbones()
|
||||
if (has_mname(mtmp))
|
||||
sanitize_name(MNAME(mtmp));
|
||||
if (mtmp->mhpmax == DEFUNCT_MONSTER) {
|
||||
if (wizard)
|
||||
if (wizard) {
|
||||
debugpline1("Removing defunct monster %s from bones.",
|
||||
mtmp->data->mname);
|
||||
}
|
||||
mongone(mtmp);
|
||||
} else
|
||||
/* to correctly reset named artifacts on the level */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 dbridge.c $NHDT-Date: 1446955279 2015/11/08 04:01:19 $ $NHDT-Branch: master $:$NHDT-Revision: 1.33 $ */
|
||||
/* NetHack 3.6 dbridge.c $NHDT-Date: 1449269914 2015/12/04 22:58:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.35 $ */
|
||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -509,8 +509,9 @@ boolean chunks;
|
||||
{
|
||||
int misses;
|
||||
|
||||
if (chunks)
|
||||
if (chunks) {
|
||||
debugpline0("Do chunks miss?");
|
||||
}
|
||||
if (automiss(etmp))
|
||||
return TRUE;
|
||||
|
||||
@@ -590,13 +591,14 @@ struct entity *etmp;
|
||||
return;
|
||||
}
|
||||
if (e_missed(etmp, FALSE)) {
|
||||
if (at_portcullis)
|
||||
if (at_portcullis) {
|
||||
pline_The("portcullis misses %s!", e_nam(etmp));
|
||||
else
|
||||
} else {
|
||||
debugpline1("The drawbridge misses %s!", e_nam(etmp));
|
||||
if (e_survives_at(etmp, oldx, oldy))
|
||||
}
|
||||
if (e_survives_at(etmp, oldx, oldy)) {
|
||||
return;
|
||||
else {
|
||||
} else {
|
||||
debugpline0("Mon can't survive here");
|
||||
if (at_portcullis)
|
||||
must_jump = TRUE;
|
||||
@@ -978,10 +980,11 @@ int x, y;
|
||||
pline("%s hit by a huge chunk of metal!",
|
||||
E_phrase(etmp1, "are"));
|
||||
} else {
|
||||
if (!Deaf && !is_u(etmp1) && !is_pool(x, y))
|
||||
if (!Deaf && !is_u(etmp1) && !is_pool(x, y)) {
|
||||
You_hear("a crushing sound.");
|
||||
else
|
||||
} else {
|
||||
debugpline1("%s from shrapnel", E_phrase(etmp1, "die"));
|
||||
}
|
||||
}
|
||||
killer.format = KILLED_BY_AN;
|
||||
Strcpy(killer.name, "collapsing drawbridge");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 dig.c $NHDT-Date: 1446369465 2015/11/01 09:17:45 $ $NHDT-Branch: master $:$NHDT-Revision: 1.99 $ */
|
||||
/* NetHack 3.6 dig.c $NHDT-Date: 1449269915 2015/12/04 22:58:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.103 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1864,8 +1864,9 @@ int x, y;
|
||||
{
|
||||
struct obj *otmp, *otmp2;
|
||||
|
||||
if (level.objects[x][y] != (struct obj *) 0)
|
||||
if (level.objects[x][y] != (struct obj *) 0) {
|
||||
debugpline2("bury_objs: at <%d,%d>", x, y);
|
||||
}
|
||||
for (otmp = level.objects[x][y]; otmp; otmp = otmp2)
|
||||
otmp2 = bury_an_obj(otmp, (boolean *) 0);
|
||||
|
||||
|
||||
39
src/eat.c
39
src/eat.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 eat.c $NHDT-Date: 1446854226 2015/11/06 23:57:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.152 $ */
|
||||
/* NetHack 3.6 eat.c $NHDT-Date: 1449269916 2015/12/04 22:58:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.154 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -728,56 +728,57 @@ register struct permonst *ptr;
|
||||
{
|
||||
int res = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
#define ifdebugresist(Msg) \
|
||||
do { \
|
||||
if (res) \
|
||||
debugpline0(Msg); \
|
||||
} while (0)
|
||||
#else
|
||||
#define ifdebugresist(Msg) /*empty*/
|
||||
#endif
|
||||
switch (type) {
|
||||
case FIRE_RES:
|
||||
res = (ptr->mconveys & MR_FIRE) != 0;
|
||||
if (res)
|
||||
debugpline0("can get fire resistance");
|
||||
ifdebugresist("can get fire resistance");
|
||||
break;
|
||||
case SLEEP_RES:
|
||||
res = (ptr->mconveys & MR_SLEEP) != 0;
|
||||
if (res)
|
||||
debugpline0("can get sleep resistance");
|
||||
ifdebugresist("can get sleep resistance");
|
||||
break;
|
||||
case COLD_RES:
|
||||
res = (ptr->mconveys & MR_COLD) != 0;
|
||||
if (res)
|
||||
debugpline0("can get cold resistance");
|
||||
ifdebugresist("can get cold resistance");
|
||||
break;
|
||||
case DISINT_RES:
|
||||
res = (ptr->mconveys & MR_DISINT) != 0;
|
||||
if (res)
|
||||
debugpline0("can get disintegration resistance");
|
||||
ifdebugresist("can get disintegration resistance");
|
||||
break;
|
||||
case SHOCK_RES: /* shock (electricity) resistance */
|
||||
res = (ptr->mconveys & MR_ELEC) != 0;
|
||||
if (res)
|
||||
debugpline0("can get shock resistance");
|
||||
ifdebugresist("can get shock resistance");
|
||||
break;
|
||||
case POISON_RES:
|
||||
res = (ptr->mconveys & MR_POISON) != 0;
|
||||
if (res)
|
||||
debugpline0("can get poison resistance");
|
||||
ifdebugresist("can get poison resistance");
|
||||
break;
|
||||
case TELEPORT:
|
||||
res = can_teleport(ptr);
|
||||
if (res)
|
||||
debugpline0("can get teleport");
|
||||
ifdebugresist("can get teleport");
|
||||
break;
|
||||
case TELEPORT_CONTROL:
|
||||
res = control_teleport(ptr);
|
||||
if (res)
|
||||
debugpline0("can get teleport control");
|
||||
ifdebugresist("can get teleport control");
|
||||
break;
|
||||
case TELEPAT:
|
||||
res = telepathic(ptr);
|
||||
if (res)
|
||||
debugpline0("can get telepathy");
|
||||
ifdebugresist("can get telepathy");
|
||||
break;
|
||||
default:
|
||||
/* res stays 0 */
|
||||
break;
|
||||
}
|
||||
#undef ifdebugresist
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 makemon.c $NHDT-Date: 1449052582 2015/12/02 10:36:22 $ $NHDT-Branch: master $:$NHDT-Revision: 1.104 $ */
|
||||
/* NetHack 3.6 makemon.c $NHDT-Date: 1449269917 2015/12/04 22:58:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.105 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -857,9 +857,10 @@ boolean ghostly;
|
||||
mvitals[mndx].born++;
|
||||
if ((int) mvitals[mndx].born >= lim && !(mons[mndx].geno & G_NOGEN)
|
||||
&& !(mvitals[mndx].mvflags & G_EXTINCT)) {
|
||||
if (wizard)
|
||||
if (wizard) {
|
||||
debugpline1("Automatically extinguished %s.",
|
||||
makeplural(mons[mndx].mname));
|
||||
}
|
||||
mvitals[mndx].mvflags |= G_EXTINCT;
|
||||
reset_rndmonst(mndx);
|
||||
}
|
||||
@@ -1072,9 +1073,10 @@ int mmflags;
|
||||
already been genocided, return */
|
||||
if (mvitals[mndx].mvflags & G_GENOD)
|
||||
return (struct monst *) 0;
|
||||
if (wizard && (mvitals[mndx].mvflags & G_EXTINCT))
|
||||
if (wizard && (mvitals[mndx].mvflags & G_EXTINCT)) {
|
||||
debugpline1("Explicitly creating extinct monster %s.",
|
||||
mons[mndx].mname);
|
||||
}
|
||||
} else {
|
||||
/* make a random (common) monster that can survive here.
|
||||
* (the special levels ask for random monsters at specific
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mkmaze.c $NHDT-Date: 1448013594 2015/11/20 09:59:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.41 $ */
|
||||
/* NetHack 3.6 mkmaze.c $NHDT-Date: 1449269918 2015/12/04 22:58:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.42 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -616,9 +616,10 @@ register const char *s;
|
||||
y_range = y_maze_max - y_maze_min - 2 * INVPOS_Y_MARGIN - 1;
|
||||
|
||||
if (x_range <= INVPOS_X_MARGIN || y_range <= INVPOS_Y_MARGIN
|
||||
|| (x_range * y_range) <= (INVPOS_DISTANCE * INVPOS_DISTANCE))
|
||||
debugpline2("inv_pos: maze is too small! (%d x %d)", x_maze_max,
|
||||
y_maze_max);
|
||||
|| (x_range * y_range) <= (INVPOS_DISTANCE * INVPOS_DISTANCE)) {
|
||||
debugpline2("inv_pos: maze is too small! (%d x %d)",
|
||||
x_maze_max, y_maze_max);
|
||||
}
|
||||
inv_pos.x = inv_pos.y = 0; /*{occupied() => invocation_pos()}*/
|
||||
do {
|
||||
x = rn1(x_range, x_maze_min + INVPOS_X_MARGIN + 1);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mon.c $NHDT-Date: 1447475944 2015/11/14 04:39:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.196 $ */
|
||||
/* NetHack 3.6 mon.c $NHDT-Date: 1449269918 2015/12/04 22:58:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.199 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1470,7 +1470,7 @@ struct monst *mtmp, *mtmp2;
|
||||
/* transfer the monster's inventory */
|
||||
for (otmp = mtmp2->minvent; otmp; otmp = otmp->nobj) {
|
||||
if (otmp->where != OBJ_MINVENT || otmp->ocarry != mtmp)
|
||||
debugpline0("replmon: minvent inconsistency");
|
||||
impossible("replmon: minvent inconsistency");
|
||||
otmp->ocarry = mtmp2;
|
||||
}
|
||||
mtmp->minvent = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1449051497 2015/12/02 10:18:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.76 $ */
|
||||
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1449269920 2015/12/04 22:58:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.77 $ */
|
||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1033,8 +1033,9 @@ chk:
|
||||
lev = &levl[x][y];
|
||||
for (; y <= ymax; y++) {
|
||||
if (lev++->typ) {
|
||||
if (!vault)
|
||||
if (!vault) {
|
||||
debugpline2("strange area [%d,%d] in check_room.", x, y);
|
||||
}
|
||||
if (!rn2(3))
|
||||
return FALSE;
|
||||
if (x < *lowx)
|
||||
|
||||
Reference in New Issue
Block a user