-/* NetHack 3.5 extern.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.390 $ */
+/* NetHack 3.5 extern.h $NHDT-Date: 1426465429 2015/03/16 00:23:49 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.406 $ */
/* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
#ifdef HOLD_LOCKFILE_OPEN
E void NDECL(really_close);
#endif
+#ifdef DEBUG
+E boolean FDECL(showdebug, (const char *));
+#endif
/* ### fountain.c ### */
-/* NetHack 3.5 hack.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 hack.h $NHDT-Date: 1426465431 2015/03/16 00:23:51 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.52 $ */
/* NetHack 3.5 hack.h $Date: 2009/05/06 10:44:46 $ $Revision: 1.49 $ */
/* SCCS Id: @(#)hack.h 3.5 2008/03/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
#include "config.h"
#endif
+/* [DEBUG shouldn't be defined unless you know what you're doing...] */
#ifdef DEBUG
-/* due to strstr(), mon.c matches makemon.c */
-# define showdebug() (sysopt.debugfiles && \
- ((sysopt.debugfiles[0] == '*') || \
- (strstr( __FILE__ , sysopt.debugfiles))))
-
-/* GCC understands this syntax */
-# ifdef __GNUC__
-/* ... but whines about it anyway without these pragmas. */
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wvariadic-macros"
-# define debugpline(args...) \
- do { if (showdebug()) pline( args ); } while(0);
-# pragma GCC diagnostic pop
-# endif
-
-/* and Visual Studio understands this one */
-# ifdef _MSC_VER
-# define debugpline(...) \
- do { if (showdebug()) pline(__VA_ARGS__); } while(0);
-# endif
-
+# define ifdebug(stmt) do { if (showdebug(__FILE__)) stmt; } while (0)
+/* these don't require compiler support for C99 variadic macros */
+# define debugpline0(str) ifdebug(pline(str))
+# define debugpline1(fmt,arg) ifdebug(pline(fmt,arg))
+# define debugpline2(fmt,a1,a2) ifdebug(pline(fmt,a1,a2))
+# define debugpline3(fmt,a1,a2,a3) ifdebug(pline(fmt,a1,a2,a3))
+# define debugpline4(fmt,a1,a2,a3,a4) ifdebug(pline(fmt,a1,a2,a3,a4))
#else
-# define showdebug() (0)
-# define debugpline(...)
-#endif
+# define debugpline0(str) /*empty*/
+# define debugpline1(fmt,arg) /*empty*/
+# define debugpline2(fmt,a1,a2) /*empty*/
+# define debugpline3(fmt,a1,a2,a3) /*empty*/
+# define debugpline4(fmt,a1,a2,a3,a4) /*empty*/
+#endif /*DEBUG*/
#define TELL 1
#define NOTELL 0
-/* NetHack 3.5 apply.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 apply.c $NHDT-Date: 1426465431 2015/03/16 00:23:51 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.173 $ */
/* NetHack 3.5 apply.c $Date: 2012/05/01 02:22:32 $ $Revision: 1.168 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
char monnambuf[BUFSZ], carriedby[BUFSZ];
if (!figurine) {
- debugpline("null figurine in fig_transform()");
+ debugpline0("null figurine in fig_transform()");
return;
}
silent = (timeout != monstermoves); /* happened while away */
-/* NetHack 3.5 attrib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 attrib.c $NHDT-Date: 1426465433 2015/03/16 00:23:53 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.34 $ */
/* NetHack 3.5 attrib.c $Date: 2011/10/01 00:25:55 $ $Revision: 1.30 $ */
/* Copyright 1988, 1989, 1990, 1992, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
int i;
boolean inc_or_dec;
{
- debugpline("Exercise:");
+ debugpline0("Exercise:");
if (i == A_INT || i == A_CHA) return; /* can't exercise these */
/* no physical exercise while polymorphed; the body's temporary */
* Note: *YES* ACURR is the right one to use.
*/
AEXE(i) += (inc_or_dec) ? (rn2(19) > ACURR(i)) : -rn2(2);
- debugpline("%s, %s AEXE = %d",
+ debugpline3("%s, %s AEXE = %d",
(i == A_STR) ? "Str" : (i == A_WIS) ? "Wis" :
(i == A_DEX) ? "Dex" : "Con",
(inc_or_dec) ? "inc" : "dec", AEXE(i));
(u.uhunger > 50) ? HUNGRY :
(u.uhunger > 0) ? WEAK : FAINTING;
- debugpline("exerper: Hunger checks");
+ debugpline0("exerper: Hunger checks");
switch (hs) {
case SATIATED: exercise(A_DEX, FALSE);
if (Role_if(PM_MONK))
}
/* Encumberance Checks */
- debugpline("exerper: Encumber checks");
+ debugpline0("exerper: Encumber checks");
switch (near_capacity()) {
case MOD_ENCUMBER: exercise(A_STR, TRUE); break;
case HVY_ENCUMBER: exercise(A_STR, TRUE);
/* status checks */
if(!(moves % 5)) {
- debugpline("exerper: Status checks");
+ debugpline0("exerper: Status checks");
if ((HClairvoyant & (INTRINSIC|TIMEOUT)) &&
!BClairvoyant) exercise(A_WIS, TRUE);
if (HRegeneration) exercise(A_STR, TRUE);
exerper();
if(moves >= context.next_attrib_check)
- debugpline("exerchk: ready to test. multi = %d.", multi);
+ debugpline1("exerchk: ready to test. multi = %d.", multi);
/* Are we ready for a test? */
if(moves >= context.next_attrib_check && !multi) {
- debugpline("exerchk: testing.");
+ debugpline0("exerchk: testing.");
/*
* Law of diminishing returns (Part II):
*
exercise/abuse gradually wears off without impact then */
if (Upolyd && i != A_WIS) goto nextattrib;
- debugpline("exerchk: testing %s (%d).",
+ debugpline2("exerchk: testing %s (%d).",
(i == A_STR) ? "Str" : (i == A_INT) ? "Int?" :
(i == A_WIS) ? "Wis" : (i == A_DEX) ? "Dex" :
(i == A_CON) ? "Con" : (i == A_CHA) ? "Cha?" : "???",
if (rn2(AVAL) > ((i != A_WIS) ? (abs(ax) * 2 / 3) : abs(ax)))
goto nextattrib;
- debugpline("exerchk: changing %d.", i);
+ debugpline1("exerchk: changing %d.", i);
if(adjattrib(i, mod_val, -1)) {
- debugpline("exerchk: changed %d.", i);
+ debugpline1("exerchk: changed %d.", i);
/* if you actually changed an attrib - zero accumulation */
AEXE(i) = ax = 0;
/* then print an explanation */
AEXE(i) = (abs(ax) / 2) * mod_val;
}
context.next_attrib_check += rn1(200,800);
- debugpline("exerchk: next check at %ld.", context.next_attrib_check);
+ debugpline1("exerchk: next check at %ld.",
+ context.next_attrib_check);
}
}
-/* NetHack 3.5 bones.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 bones.c $NHDT-Date: 1426465433 2015/03/16 00:23:53 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.45 $ */
/* NetHack 3.5 bones.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.39 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985,1993. */
/* NetHack may be freely redistributed. See license for details. */
if (has_mname(mtmp)) sanitize_name(MNAME(mtmp));
if (mtmp->mhpmax == DEFUNCT_MONSTER) {
if (wizard)
- debugpline("Removing defunct monster %s from bones.",
+ debugpline1("Removing defunct monster %s from bones.",
mtmp->data->mname);
mongone(mtmp);
} else
-/* NetHack 3.5 dbridge.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 dbridge.c $NHDT-Date: 1426465433 2015/03/16 00:23:53 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.23 $ */
/* NetHack 3.5 dbridge.c $Date: 2012/02/01 00:49:16 $ $Revision: 1.21 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
(occupants[entitycnt].ex == x) &&
(occupants[entitycnt].ey == y))
break;
- debugpline("entitycnt = %d", entitycnt);
+ debugpline1("entitycnt = %d", entitycnt);
#ifdef D_DEBUG
wait_synch();
#endif
int misses;
if (chunks)
- debugpline("Do chunks miss?");
+ debugpline0("Do chunks miss?");
if (automiss(etmp))
return(TRUE);
if (is_db_wall(etmp->ex, etmp->ey))
misses -= 3; /* less airspace */
- debugpline("Miss chance = %d (out of 8)", misses);
+ debugpline1("Miss chance = %d (out of 8)", misses);
return((boolean)((misses >= rnd(8))? TRUE : FALSE));
}
if (is_db_wall(etmp->ex, etmp->ey))
tmp -= 2; /* less room to maneuver */
- debugpline("%s to jump (%d chances in 10)", E_phrase(etmp, "try"), tmp);
+ debugpline2("%s to jump (%d chances in 10)",
+ E_phrase(etmp, "try"), tmp);
return((boolean)((tmp >= rnd(10))? TRUE : FALSE));
}
pline_The("portcullis misses %s!",
e_nam(etmp));
else
- debugpline("The drawbridge misses %s!",
- e_nam(etmp));
+ debugpline1("The drawbridge misses %s!", e_nam(etmp));
if (e_survives_at(etmp, oldx, oldy))
return;
else {
- debugpline("Mon can't survive here");
+ debugpline0("Mon can't survive here");
if (at_portcullis)
must_jump = TRUE;
else
if (at_portcullis) {
if (e_jumps(etmp)) {
relocates = TRUE;
- debugpline("Jump succeeds!");
+ debugpline0("Jump succeeds!");
} else {
if (e_inview)
pline("%s crushed by the falling portcullis!",
}
} else { /* tries to jump off bridge to original square */
relocates = !e_jumps(etmp);
- debugpline("Jump %s!", (relocates)? "fails" : "succeeds");
+ debugpline1("Jump %s!", (relocates)? "fails" : "succeeds");
}
}
* would be inaccessible (i.e. etmp started on drawbridge square) or
* unnecessary (i.e. etmp started here) in such a situation.
*/
- debugpline("Doing relocation.");
+ debugpline0("Doing relocation.");
newx = oldx;
newy = oldy;
(void)find_drawbridge(&newx, &newy);
if ((newx == oldx) && (newy == oldy))
get_wall_for_db(&newx, &newy);
- debugpline("Checking new square for occupancy.");
+ debugpline0("Checking new square for occupancy.");
if (relocates && (e_at(newx, newy))) {
/*
struct entity *other;
other = e_at(newx, newy);
- debugpline("New square is occupied by %s", e_nam(other));
+ debugpline1("New square is occupied by %s", e_nam(other));
if (e_survives_at(other, newx, newy) && automiss(other)) {
relocates = FALSE; /* "other" won't budge */
- debugpline("%s suicide.", E_phrase(etmp, "commit"));
+ debugpline1("%s suicide.", E_phrase(etmp, "commit"));
} else {
- debugpline("Handling %s", e_nam(other));
+ debugpline1("Handling %s", e_nam(other));
while ((e_at(newx, newy) != 0) &&
(e_at(newx, newy) != etmp))
do_entity(other);
- debugpline("Checking existence of %s", e_nam(etmp));
+ debugpline1("Checking existence of %s", e_nam(etmp));
#ifdef D_DEBUG
wait_synch();
#endif
if (e_at(oldx, oldy) != etmp) {
- debugpline("%s moved or died in recursion somewhere",
+ debugpline1("%s moved or died in recursion somewhere",
E_phrase(etmp, "have"));
#ifdef D_DEBUG
wait_synch();
}
}
if (relocates && !e_at(newx, newy)) {/* if e_at() entity = worm tail */
- debugpline("Moving %s", e_nam(etmp));
+ debugpline1("Moving %s", e_nam(etmp));
if (!is_u(etmp)) {
remove_monster(etmp->ex, etmp->ey);
place_monster(etmp->emon, newx, newy);
etmp->ey = newy;
e_inview = e_canseemon(etmp);
}
- debugpline("Final disposition of %s", e_nam(etmp));
+ debugpline1("Final disposition of %s", e_nam(etmp));
#ifdef D_DEBUG
wait_synch();
#endif
if (is_db_wall(etmp->ex, etmp->ey)) {
- debugpline("%s in portcullis chamber", E_phrase(etmp, "are"));
+ debugpline1("%s in portcullis chamber", E_phrase(etmp, "are"));
#ifdef D_DEBUG
wait_synch();
#endif
e_died(etmp, 0, CRUSHING); /* no message */
return;
}
- debugpline("%s in here", E_phrase(etmp, "survive"));
+ debugpline1("%s in here", E_phrase(etmp, "survive"));
} else {
- debugpline("%s on drawbridge square", E_phrase(etmp, "are"));
+ debugpline1("%s on drawbridge square", E_phrase(etmp, "are"));
if (is_pool(etmp->ex, etmp->ey) && !e_inview)
if (!Deaf)
You_hear("a splash.");
E_phrase(etmp, "fall"));
return;
}
- debugpline("%s cannot survive on the drawbridge square",E_phrase(etmp, NULL));
+ debugpline1("%s cannot survive on the drawbridge square",
+ E_phrase(etmp, NULL));
if (is_pool(etmp->ex, etmp->ey) || is_lava(etmp->ex, etmp->ey))
if (e_inview && !is_u(etmp)) {
/* drown() will supply msgs if nec. */
if (etmp1->edata) {
e_inview = e_canseemon(etmp1);
if (e_missed(etmp1, TRUE)) {
- debugpline("%s spared!", E_phrase(etmp1, "are"));
+ debugpline1("%s spared!", E_phrase(etmp1, "are"));
/* if there is water or lava here, fall in now */
if (is_u(etmp1))
spoteffects(FALSE);
if (!Deaf && !is_u(etmp1) && !is_pool(x,y))
You_hear("a crushing sound.");
else
- debugpline("%s from shrapnel",
+ debugpline1("%s from shrapnel",
E_phrase(etmp1, "die"));
}
killer.format = KILLED_BY_AN;
-/* NetHack 3.5 dig.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 dig.c $NHDT-Date: 1426465434 2015/03/16 00:23:54 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.73 $ */
/* NetHack 3.5 dig.c $Date: 2012/02/16 03:01:37 $ $Revision: 1.67 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
struct obj *otmp2;
boolean under_ice;
- debugpline("bury_an_obj: %s", xname(otmp));
+ debugpline1("bury_an_obj: %s", xname(otmp));
if (otmp == uball) {
unpunish();
u.utrap = rn1(50,20);
struct obj *otmp, *otmp2;
if(level.objects[x][y] != (struct obj *)0)
- debugpline("bury_objs: at %d, %d", x, y);
+ debugpline2("bury_objs: at <%d,%d>", x, y);
for (otmp = level.objects[x][y]; otmp; otmp = otmp2)
otmp2 = bury_an_obj(otmp);
struct obj *otmp, *otmp2, *bball;
coord cc;
- debugpline("unearth_objs: at %d, %d", x, y);
+ debugpline2("unearth_objs: at <%d,%d>", x, y);
cc.x = x; cc.y = y;
bball = buried_ball(&cc);
for (otmp = level.buriedobjlist; otmp; otmp = otmp2) {
bury_monst(mtmp)
struct monst *mtmp;
{
- debugpline("bury_monst: %s", mon_nam(mtmp));
+ debugpline1("bury_monst: %s", mon_nam(mtmp));
if(canseemon(mtmp)) {
if(is_flyer(mtmp->data) || is_floater(mtmp->data)) {
pline_The("%s opens up, but %s is not swallowed!",
void
bury_you()
{
- debugpline("bury_you");
+ debugpline0("bury_you");
if (!Levitation && !Flying) {
if(u.uswallow)
You_feel("a sensation like falling into a trap!");
void
unearth_you()
{
- debugpline("unearth_you");
+ debugpline0("unearth_you");
u.uburied = FALSE;
under_ground(0);
if(!uamul || uamul->otyp != AMULET_OF_STRANGULATION)
void
escape_tomb()
{
- debugpline("escape_tomb");
+ debugpline0("escape_tomb");
if ((Teleportation || can_teleport(youmonst.data)) &&
(Teleport_control || rn2(3) < Luck+2)) {
You("attempt a teleport spell.");
struct obj *otmp;
{
- debugpline("bury_obj");
+ debugpline0("bury_obj");
if(cansee(otmp->ox, otmp->oy))
pline_The("objects on the %s tumble into a hole!",
surface(otmp->ox, otmp->oy));
-/* NetHack 3.5 dungeon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 dungeon.c $NHDT-Date: 1426465434 2015/03/16 00:23:54 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.39 $ */
/* NetHack 3.5 dungeon.c $Date: 2012/04/14 08:31:05 $ $Revision: 1.34 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
s_level *x;
branch *br;
- if (!showdebug()) return;
+ if (!showdebug(__FILE__)) return;
for(i = 0; i < n_dgns; i++) {
fprintf(stderr, "\n#%d \"%s\" (%s):\n", i,
-/* NetHack 3.5 eat.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 eat.c $NHDT-Date: 1426465435 2015/03/16 00:23:55 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.123 $ */
/* NetHack 3.5 eat.c $Date: 2012/02/01 00:49:16 $ $Revision: 1.116 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
{
struct obj *piece = context.victual.piece;
- debugpline("Old weight = %d", piece->owt);
- debugpline("Used time = %d, Req'd time = %d",
- context.victual.usedtime, context.victual.reqtime);
+ debugpline1("Old weight = %d", piece->owt);
+ debugpline2("Used time = %d, Req'd time = %d",
+ context.victual.usedtime, context.victual.reqtime);
piece->owt = weight(piece);
- debugpline("New weight = %d", piece->owt);
+ debugpline1("New weight = %d", piece->owt);
}
void
* the round is spent eating.
*/
if(context.victual.eating && !context.victual.doreset) {
- debugpline("reset_eat...");
+ debugpline0("reset_eat...");
context.victual.doreset = TRUE;
}
return;
(void) splitobj(otmp, otmp->quan - 1L);
else
otmp = splitobj(otmp, 1L);
- debugpline("split object,");
+ debugpline0("split object,");
}
if (!otmp->oeaten) {
STATIC_OVL void
do_reset_eat()
{
- debugpline("do_reset_eat...");
+ debugpline0("do_reset_eat...");
if (context.victual.piece) {
context.victual.o_id = 0;
context.victual.piece = touchfood(context.victual.piece);
switch (type) {
case FIRE_RES:
res = (ptr->mconveys & MR_FIRE) != 0;
- if (res) debugpline("can get fire resistance");
+ if (res) debugpline0("can get fire resistance");
break;
case SLEEP_RES:
res = (ptr->mconveys & MR_SLEEP) != 0;
- if (res) debugpline("can get sleep resistance");
+ if (res) debugpline0("can get sleep resistance");
break;
case COLD_RES:
res = (ptr->mconveys & MR_COLD) != 0;
- if (res) debugpline("can get cold resistance");
+ if (res) debugpline0("can get cold resistance");
break;
case DISINT_RES:
res = (ptr->mconveys & MR_DISINT) != 0;
- if (res) debugpline("can get disintegration resistance");
+ if (res) debugpline0("can get disintegration resistance");
break;
case SHOCK_RES: /* shock (electricity) resistance */
res = (ptr->mconveys & MR_ELEC) != 0;
- if (res) debugpline("can get shock resistance");
+ if (res) debugpline0("can get shock resistance");
break;
case POISON_RES:
res = (ptr->mconveys & MR_POISON) != 0;
- if (res) debugpline("can get poison resistance");
+ if (res) debugpline0("can get poison resistance");
break;
case TELEPORT:
res = can_teleport(ptr);
- if (res) debugpline("can get teleport");
+ if (res) debugpline0("can get teleport");
break;
case TELEPORT_CONTROL:
res = control_teleport(ptr);
- if (res) debugpline("can get teleport control");
+ if (res) debugpline0("can get teleport control");
break;
case TELEPAT:
res = telepathic(ptr);
- if (res) debugpline("can get telepathy");
+ if (res) debugpline0("can get telepathy");
break;
default:
/* res stays 0 */
{
register int chance;
- debugpline("Attempting to give intrinsic %d", type);
+ debugpline1("Attempting to give intrinsic %d", type);
/* some intrinsics are easier to get than others */
switch (type) {
case POISON_RES:
switch (type) {
case FIRE_RES:
- debugpline("Trying to give fire resistance");
+ debugpline0("Trying to give fire resistance");
if(!(HFire_resistance & FROMOUTSIDE)) {
You(Hallucination ? "be chillin'." :
"feel a momentary chill.");
}
break;
case SLEEP_RES:
- debugpline("Trying to give sleep resistance");
+ debugpline0("Trying to give sleep resistance");
if(!(HSleep_resistance & FROMOUTSIDE)) {
You_feel("wide awake.");
HSleep_resistance |= FROMOUTSIDE;
}
break;
case COLD_RES:
- debugpline("Trying to give cold resistance");
+ debugpline0("Trying to give cold resistance");
if(!(HCold_resistance & FROMOUTSIDE)) {
You_feel("full of hot air.");
HCold_resistance |= FROMOUTSIDE;
}
break;
case DISINT_RES:
- debugpline("Trying to give disintegration resistance");
+ debugpline0("Trying to give disintegration resistance");
if(!(HDisint_resistance & FROMOUTSIDE)) {
You_feel(Hallucination ?
"totally together, man." :
}
break;
case SHOCK_RES: /* shock (electricity) resistance */
- debugpline("Trying to give shock resistance");
+ debugpline0("Trying to give shock resistance");
if(!(HShock_resistance & FROMOUTSIDE)) {
if (Hallucination)
You_feel("grounded in reality.");
}
break;
case POISON_RES:
- debugpline("Trying to give poison resistance");
+ debugpline0("Trying to give poison resistance");
if(!(HPoison_resistance & FROMOUTSIDE)) {
You_feel(Poison_resistance ?
"especially healthy." : "healthy.");
}
break;
case TELEPORT:
- debugpline("Trying to give teleport");
+ debugpline0("Trying to give teleport");
if(!(HTeleportation & FROMOUTSIDE)) {
You_feel(Hallucination ? "diffuse." :
"very jumpy.");
}
break;
case TELEPORT_CONTROL:
- debugpline("Trying to give teleport control");
+ debugpline0("Trying to give teleport control");
if(!(HTeleport_control & FROMOUTSIDE)) {
You_feel(Hallucination ?
"centered in your personal space." :
}
break;
case TELEPAT:
- debugpline("Trying to give telepathy");
+ debugpline0("Trying to give telepathy");
if(!(HTelepat & FROMOUTSIDE)) {
You_feel(Hallucination ?
"in touch with the cosmos." :
}
break;
default:
- debugpline("Tried to give an impossible intrinsic");
+ debugpline0("Tried to give an impossible intrinsic");
break;
}
}
case PM_DISENCHANTER:
/* picks an intrinsic at random and removes it; there's
no feedback if hero already lacks the chosen ability */
- debugpline("using attrcurse to strip an intrinsic");
+ debugpline0("using attrcurse to strip an intrinsic");
attrcurse();
break;
case PM_MIND_FLAYER:
if (conveys_STR) {
count = 1;
tmp = -1; /* use -1 as fake prop index for STR */
- debugpline("\"Intrinsic\" strength, %d", tmp);
+ debugpline1("\"Intrinsic\" strength, %d", tmp);
}
for (i = 1; i <= LAST_PROP; i++) {
if (!intrinsic_possible(i, ptr)) continue;
of keeping the old choice (note that 1 in 1 and
0 in 1 are what we want for the first candidate) */
if (!rn2(count)) {
- debugpline("Intrinsic %d replacing %d", i, tmp);
+ debugpline2("Intrinsic %d replacing %d", i, tmp);
tmp = i;
}
}
{
const char *old_nomovemsg, *save_nomovemsg;
- debugpline("start_eating: %p (victual = %p)", otmp, context.victual.piece);
- debugpline("reqtime = %d", context.victual.reqtime);
- debugpline("(original reqtime = %d)", objects[otmp->otyp].oc_delay);
- debugpline("nmod = %d", context.victual.nmod);
- debugpline("oeaten = %d", otmp->oeaten);
+ debugpline2("start_eating: %lx (victual = %lx)",
+ (unsigned long)otmp, (unsigned long)context.victual.piece);
+ debugpline1("reqtime = %d", context.victual.reqtime);
+ debugpline1("(original reqtime = %d)", objects[otmp->otyp].oc_delay);
+ debugpline1("nmod = %d", context.victual.nmod);
+ debugpline1("oeaten = %d", otmp->oeaten);
context.victual.fullwarn = context.victual.doreset = FALSE;
context.victual.eating = TRUE;
if (otmp->otyp == CORPSE) basenutrit = mons[otmp->corpsenm].cnutrit;
else basenutrit = objects[otmp->otyp].oc_nutrition;
- debugpline("before rounddiv: context.victual.reqtime == %d", context.victual.reqtime);
- debugpline("oeaten == %d, basenutrit == %d", otmp->oeaten, basenutrit);
+ debugpline1("before rounddiv: context.victual.reqtime == %d",
+ context.victual.reqtime);
+ debugpline2("oeaten == %d, basenutrit == %d",
+ otmp->oeaten, basenutrit);
context.victual.reqtime = (basenutrit == 0 ? 0 :
rounddiv(context.victual.reqtime * (long)otmp->oeaten, basenutrit));
- debugpline("after rounddiv: context.victual.reqtime == %d", context.victual.reqtime);
+ debugpline1("after rounddiv: context.victual.reqtime == %d",
+ context.victual.reqtime);
/* calculate the modulo value (nutrit. units per round eating)
* note: this isn't exact - you actually lose a little nutrition
* due to this method.
{
/* See comments in newuhs() for discussion on force_save_hs */
boolean iseating = (occupation == eatfood) || force_save_hs;
- debugpline("lesshungry(%d)", num);
+ debugpline1("lesshungry(%d)", num);
u.uhunger += num;
if(u.uhunger >= 2000) {
if (!iseating || context.victual.canchoke) {
-/* NetHack 3.5 files.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.127 $ */
+/* NetHack 3.5 files.c $NHDT-Date: 1426465435 2015/03/16 00:23:55 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.133 $ */
/* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/* ---------- END INTERNAL RECOVER ----------- */
#endif /*SELF_RECOVER*/
+#ifdef DEBUG
+/* used by debugpline() to decide whether to issue a message
+ from a partiular source file; caller passes __FILE__ and we check
+ whether it is in the source file list supplied by SYSCF's DEBUGFILES */
+boolean
+showdebug(filename)
+const char *filename;
+{
+ const char *debugfiles, *p;
+
+ if (!filename || !*filename) return FALSE; /* sanity precaution */
+
+ debugfiles = sysopt.debugfiles;
+ /* usual case: sysopt.debugfiles will be empty */
+ if (!debugfiles || !*debugfiles) return FALSE;
+
+ /* strip filename's path if present */
+# ifdef UNIX
+ if ((p = rindex(filename, '/')) != 0) filename = p + 1;
+# endif
+# ifdef VMS
+ filename = vms_basename(filename);
+ /* vms_basename strips off 'type' suffix as well as path and version;
+ we want to put suffix back (".c" assumed); since it always returns
+ a pointer to a static buffer, we can safely modify its result */
+ Strcat((char *)filename, ".c");
+# endif
+
+ /*
+ * Wildcard match will only work if there's a single pattern (which
+ * might be a single file name without any wildcarding) rather than
+ * a space-separated list.
+ * [to NOT do: We could step through the space-separated list and
+ * attempt a wildcard match against each element, but that would be
+ * overkill for the intended usage.]
+ */
+ if (pmatch(debugfiles, filename))
+ return TRUE;
+
+ /* check whether filename is an element of the list */
+ if ((p = strstr(debugfiles, filename)) != 0) {
+ int l = (int)strlen(filename);
+
+ if ((p == debugfiles || p[-1] == ' ' || p[-1] == '/')
+ && (p[l] == ' ' || p[l] == '\0'))
+ return TRUE;
+ }
+ return FALSE;
+}
+#endif /*DEBUG*/
+
/*files.c*/
-/* NetHack 3.5 light.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 light.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.17 $ */
/* NetHack 3.5 light.c $Date: 2009/05/06 10:46:38 $ $Revision: 1.15 $ */
/* SCCS Id: @(#)light.c 3.5 2009/01/20 */
/* Copyright (c) Dean Luick, 1994 */
ls->id = zeroany;
ls->id.a_uint = otmp->o_id;
if (find_oid((unsigned)ls->id.a_uint) != otmp)
- debugpline("write_ls: can't find obj #%u!", ls->id.a_uint);
+ impossible("write_ls: can't find obj #%u!", ls->id.a_uint);
} else { /* ls->type == LS_MONSTER */
mtmp = (struct monst *)ls->id.a_monst;
ls->id = zeroany;
ls->id.a_uint = mtmp->m_id;
if (find_mid((unsigned)ls->id.a_uint, FM_EVERYWHERE) != mtmp)
- debugpline("write_ls: can't find mon #%u!", ls->id.a_uint);
+ impossible("write_ls: can't find mon #%u!", ls->id.a_uint);
}
ls->flags |= LSF_NEEDS_FIXUP;
bwrite(fd, (genericptr_t)ls, sizeof(light_source));
-/* NetHack 3.5 makemon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 makemon.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.74 $ */
/* NetHack 3.5 makemon.c $Date: 2012/01/29 00:34:33 $ $Revision: 1.69 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
int cnttmp,cntdiv;
cnttmp = cnt;
- debugpline("init group call x=%d,y=%d,n=%d,cnt=%d.", x, y, n, cnt);
+ debugpline4("init group call <%d,%d>, n=%d, cnt=%d.", x, y, n, cnt);
cntdiv = ((u.ulevel < 3) ? 4 : (u.ulevel < 5) ? 2 : 1);
#endif
/* Tuning: cut down on swarming at low character levels [mrs] */
mvitals[mndx].born++;
if ((int) mvitals[mndx].born >= lim && !(mons[mndx].geno & G_NOGEN) &&
!(mvitals[mndx].mvflags & G_EXTINCT)) {
- if (wizard) debugpline("Automatically extinguished %s.",
+ if (wizard) debugpline1("Automatically extinguished %s.",
makeplural(mons[mndx].mname));
mvitals[mndx].mvflags |= G_EXTINCT;
reset_rndmonst(mndx);
already been genocided, return */
if (mvitals[mndx].mvflags & G_GENOD) return((struct monst *) 0);
if (wizard && (mvitals[mndx].mvflags & G_EXTINCT))
- debugpline("Explicitly creating extinct monster %s.",
- mons[mndx].mname);
+ 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
do {
if(!(ptr = rndmonst())) {
- debugpline("Warning: no monster.");
+ debugpline0("Warning: no monster.");
return((struct monst *) 0); /* no more monsters! */
}
fakemon.data = ptr; /* set up for goodpos */
}
if (mndx == SPECIAL_PM) {
/* evidently they've all been exterminated */
- debugpline("rndmonst: no common mons!");
+ debugpline0("rndmonst: no common mons!");
return (struct permonst *)0;
} /* else `mndx' now ready for use below */
zlevel = level_difficulty();
if (rndmonst_state.choice_count <= 0) {
/* maybe no common mons left, or all are too weak or too strong */
- debugpline("rndmonst: choice_count=%d", rndmonst_state.choice_count);
+ debugpline1("rndmonst: choice_count=%d",
+ rndmonst_state.choice_count);
return (struct permonst *)0;
}
-/* NetHack 3.5 mklev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 mklev.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.25 $ */
/* NetHack 3.5 mklev.c $Date: 2012/02/15 01:55:33 $ $Revision: 1.20 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/* make a secret treasure vault, not connected to the rest */
if(do_vault()) {
xchar w,h;
- debugpline("trying to make a vault...");
+ debugpline0("trying to make a vault...");
w = 1;
h = 1;
if (check_room(&vault_x, &w, &vault_y, &h, TRUE)) {
*source = u.uz;
insert_branch(br, TRUE);
- debugpline("Made knox portal.");
+ debugpline0("Made knox portal.");
place_branch(br, x, y);
}
-/* NetHack 3.5 mkmaze.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 mkmaze.c $NHDT-Date: 1426465437 2015/03/16 00:23:57 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.20 $ */
/* NetHack 3.5 mkmaze.c $Date: 2009/05/06 10:46:56 $ $Revision: 1.18 $ */
/* SCCS Id: @(#)mkmaze.c 3.5 2007/06/18 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
if (x_range <= INVPOS_X_MARGIN || y_range <= INVPOS_Y_MARGIN ||
(x_range * y_range) <= (INVPOS_DISTANCE * INVPOS_DISTANCE))
- debugpline("inv_pos: maze is too small! (%d x %d)",
+ 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 {
impossible("portal on top of portal??");
return;
}
- debugpline("mkportal: at (%d,%d), to %s, level %d",
+ debugpline4("mkportal: at <%d,%d>, to %s, level %d",
x, y, dungeons[todnum].dname, todlevel);
ttmp->dst.dnum = todnum;
ttmp->dst.dlevel = todlevel;
-/* NetHack 3.5 mkobj.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 mkobj.c $NHDT-Date: 1426465437 2015/03/16 00:23:57 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.77 $ */
/* NetHack 3.5 mkobj.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.70 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/* Adjust the age; must be same as obj_timer_checks() for off ice*/
age = monstermoves - otmp->age;
retval += age * (ROT_ICE_ADJUSTMENT-1) / ROT_ICE_ADJUSTMENT;
- debugpline("The %s age has ice modifications:otmp->age = %ld, returning %ld.",
- s_suffix(doname(otmp)),otmp->age, retval);
- debugpline("Effective age of corpse: %ld.",
- monstermoves - retval);
+ debugpline3("The %s age has ice modifications: otmp->age = %ld, returning %ld.",
+ s_suffix(doname(otmp)), otmp->age, retval);
+ debugpline1("Effective age of corpse: %ld.", monstermoves - retval);
}
return retval;
}
/* mark the corpse as being on ice */
otmp->on_ice = 1;
- debugpline("%s is now on ice at %d,%d.", The(xname(otmp)),x,y);
+ debugpline3("%s is now on ice at <%d,%d>.",
+ The(xname(otmp)), x, y);
/* Adjust the time remaining */
tleft *= ROT_ICE_ADJUSTMENT;
restart_timer = TRUE;
long age;
otmp->on_ice = 0;
- debugpline("%s is no longer on ice at %d,%d.", The(xname(otmp)),x,y);
+ debugpline3("%s is no longer on ice at <%d,%d>.",
+ The(xname(otmp)), x, y);
/* Adjust the remaining time */
tleft /= ROT_ICE_ADJUSTMENT;
restart_timer = TRUE;
-/* NetHack 3.5 mon.c $NHDT-Date: 1425319883 2015/03/02 18:11:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.137 $ */
+/* NetHack 3.5 mon.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.139 $ */
/* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/* transfer the monster's inventory */
for (otmp = mtmp2->minvent; otmp; otmp = otmp->nobj) {
if (otmp->where != OBJ_MINVENT || otmp->ocarry != mtmp)
- debugpline("replmon: minvent inconsistency");
+ debugpline0("replmon: minvent inconsistency");
otmp->ocarry = mtmp2;
}
mtmp->minvent = 0;
-/* NetHack 3.5 pickup.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.126 $ */
+/* NetHack 3.5 pickup.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.130 $ */
/* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
(*pick_list)->item.a_int = curr->oclass;
return 1;
} else {
- debugpline("query_category: no single object match");
+ debugpline0("query_category: no single object match");
}
return 0;
}
-/* NetHack 3.5 questpgr.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 questpgr.c $NHDT-Date: 1426465439 2015/03/16 00:23:59 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.18 $ */
/* NetHack 3.5 questpgr.c $Date: 2012/02/02 09:18:14 $ $Revision: 1.14 $ */
/* Copyright 1991, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
{
struct qtmsg *msg;
- if (!showdebug()) return;
+ if (!showdebug(__FILE__)) return;
for (msg = qt_list.chrole; msg->msgnum > 0; msg++) {
pline("msgnum %d: delivery %c",
-/* NetHack 3.5 restore.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 restore.c $NHDT-Date: 1426465439 2015/03/16 00:23:59 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.77 $ */
/* NetHack 3.5 restore.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.71 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
++msgcount;
}
if (msgcount) putmsghistory((char *)0, TRUE);
- debugpline("Read %d messages from savefile.", msgcount);
+ debugpline1("Read %d messages from savefile.", msgcount);
}
/* Clear all structures for object and monster ID mapping. */
-/* NetHack 3.5 rnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 rnd.c $NHDT-Date: 1426465440 2015/03/16 00:24:00 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.8 $ */
/* NetHack 3.5 rnd.c $Date: 2009/05/06 10:47:41 $ $Revision: 1.7 $ */
/* SCCS Id: @(#)rnd.c 3.5 2004/08/27 */
/* NetHack may be freely redistributed. See license for details. */
{
#ifdef BETA
if (x <= 0) {
- debugpline("rn2(%d) attempted", x);
+ debugpline1("rn2(%d) attempted", x);
return(0);
}
x = RND(x);
#ifdef BETA
if (x <= 0) {
- debugpline("rnl(%d) attempted", x);
+ debugpline1("rnl(%d) attempted", x);
return(0);
}
#endif
{
#ifdef BETA
if (x <= 0) {
- debugpline("rnd(%d) attempted", x);
+ debugpline1("rnd(%d) attempted", x);
return(1);
}
x = RND(x)+1;
#ifdef BETA
if (x < 0 || n < 0 || (x == 0 && n != 0)) {
- debugpline("d(%d,%d) attempted", n, x);
+ debugpline2("d(%d,%d) attempted", n, x);
return(1);
}
#endif
-/* NetHack 3.5 save.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.59 $ */
+/* NetHack 3.5 save.c $NHDT-Date: 1426465440 2015/03/16 00:24:00 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.61 $ */
/* NetHack 3.5 save.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.53 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
}
bwrite(fd, (genericptr_t) &minusone, sizeof(int));
}
- debugpline("Stored %d messages into savefile.", msgcount);
+ debugpline1("Stored %d messages into savefile.", msgcount);
/* note: we don't attempt to handle release_data() here */
}
-/* NetHack 3.5 shk.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 shk.c $NHDT-Date: 1426465441 2015/03/16 00:24:01 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.96 $ */
/* NetHack 3.5 shk.c $Date: 2012/07/03 22:54:49 $ $Revision: 1.91 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
}
if(!shkp) {
- debugpline("dopay: null shkp.");
+ debugpline0("dopay: null shkp.");
return(0);
}
proceed:
-/* NetHack 3.5 sp_lev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 sp_lev.c $NHDT-Date: 1426465441 2015/03/16 00:24:01 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.25 $ */
/* NetHack 3.5 sp_lev.c $Date: 2011/01/05 01:28:36 $ $Revision: 1.23 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
lev = &levl[x][y];
for (; y <= ymax; y++) {
if (lev++->typ) {
- if(!vault)
- debugpline("strange area [%d,%d] in check_room.",x,y);
+ if (!vault)
+ debugpline2("strange area [%d,%d] in check_room.", x, y);
if (!rn2(3)) return FALSE;
if (x < *lowx)
*lowx = x + xlim + 1;
r1 = rnd_rect(); /* Get a random rectangle */
if (!r1) { /* No more free rectangles ! */
- debugpline("No more rects...");
+ debugpline0("No more rects...");
return FALSE;
}
hx = r1->hx;
if (xx <= 0 || yy <= 0 || tx <= 0 || ty <= 0 ||
xx > COLNO-1 || tx > COLNO-1 ||
yy > ROWNO-1 || ty > ROWNO-1) {
- debugpline("dig_corridor: bad coords : (%d,%d) (%d,%d).",
- xx,yy,tx,ty);
+ debugpline4("dig_corridor: bad coords <%d,%d> <%d,%d>.",
+ xx, yy, tx, ty);
return FALSE;
}
if (tx > xx) dx = 1;
-/* NetHack 3.5 sys.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 sys.c $NHDT-Date: 1426465442 2015/03/16 00:24:02 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.16 $ */
/* NetHack 3.5 sys.c $Date: 2012/03/10 02:22:07 $ $Revision: 1.12 $ */
/* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
-/* for KR1ED config, WIZARD is 0 or 1 and WIZARD_NAME is a string;
- for usual config, WIZARD is the string; forcing WIZARD_NAME to match it
- eliminates conditional testing for which one to use in string ops */
+#ifndef SYSCF
+/* !SYSCF configurations need '#define DEBUGFILES "foo.c bar.c"'
+ to enable debugging feedback for source files foo.c and bar.c;
+ to activate debugpline(), set an appropriate value and uncomment */
+/* # define DEBUGFILES "*" */
+#endif
struct sysopt sysopt;
void
-sys_early_init(){
+sys_early_init()
+{
sysopt.support = NULL;
sysopt.recover = NULL;
#ifdef SYSCF
sysopt.wizards = NULL;
#else
- sysopt.wizards = WIZARD_NAME;
+ sysopt.wizards = dupstr(WIZARD_NAME);
#endif
+#if defined(SYSCF) || !defined(DEBUGFILES)
sysopt.debugfiles = NULL;
+#else
+ sysopt.debugfiles = dupstr(DEBUGFILES);
+#endif
sysopt.shellers = NULL;
sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */
-/* NetHack 3.5 teleport.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 teleport.c $NHDT-Date: 1426465443 2015/03/16 00:24:03 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.48 $ */
/* NetHack 3.5 teleport.c $Date: 2012/01/04 18:52:36 $ $Revision: 1.45 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
struct monst fakemon; /* dummy monster */
if (!mdat) {
- debugpline("enexto() called with mdat==0");
+ debugpline0("enexto() called with null mdat");
/* default to player's original monster type */
mdat = &mons[u.umonster];
}
-/* NetHack 3.5 zap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 zap.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.195 $ */
/* NetHack 3.5 zap.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.183 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
* as a safeguard against any stray occurrence left in an obj
* struct someplace, although that should never happen.
*/
- if (context.bypasses)
+ if (context.bypasses) {
return 0;
- else {
- debugpline("%s for a moment.", Tobjnam(obj, "pulsate"));
+ } else {
+ debugpline1("%s for a moment.",
+ Tobjnam(obj, "pulsate"));
obj->bypass = 0;
}
}
resist(mon, type < ZT_SPELL(0) ? WAND_CLASS : '\0', 0, NOTELL))
tmp /= 2;
if (tmp < 0) tmp = 0; /* don't allow negative damage */
- debugpline("zapped monster hp = %d (= %d - %d)", mon->mhp-tmp,mon->mhp,tmp);
+ debugpline3("zapped monster hp = %d (= %d - %d)",
+ mon->mhp-tmp, mon->mhp, tmp);
mon->mhp -= tmp;
return(tmp);
}
-/* NetHack 3.5 wintty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
+/* NetHack 3.5 wintty.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.71 $ */
/* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */
/* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */
case NHW_TEXT: s = "[text window]"; break;
case NHW_BASE: s = "[base window]"; break;
}
- debugpline("bad curs positioning win %d %s (%d,%d)", window, s, x, y);
+ debugpline4("bad curs positioning win %d %s (%d,%d)", window, s, x, y);
return;
}
#endif