#define OFF 0
#define BOLT_LIM 8 /* from this distance ranged attacks will be made */
#define MAX_CARR_CAP 1000 /* so that boulders can be heavier */
- #define DUMMY \
- { \
- 0 \
- }
+ #define DUMMY { 0 } /* array initializer, letting [1..N-1] default */
+/* The UNDEFINED macros are used to initialize variables whose
+ initialized value is not relied upon.
+ UNDEFINED_VALUE: used to initialize any scalar type except pointers.
+ UNDEFINED_VALUES: used to initialize any non scalar type without pointers.
+ UNDEFINED_PTR: can be used only on pointer types. */
+#define UNDEFINED_VALUE 0
+#define UNDEFINED_VALUES { 0 }
+#define UNDEFINED_PTR NULL
+
/* symbolic names for capacity levels */
enum encumbrance_types {
UNENCUMBERED = 0,
m_into_limbo(mtmp);
return;
}
- if (!isok(mm.x, mm.y))
- return;
rloc_to(mtmp, mm.x, mm.y);
- if (!in_mklev && (mtmp->mstrategy & STRAT_APPEARMSG)) {
+ if (!g.in_mklev && (mtmp->mstrategy & STRAT_APPEARMSG)) {
mtmp->mstrategy &= ~STRAT_APPEARMSG; /* one chance only */
if (!couldspot && canspotmon(mtmp))
pline("%s suddenly %s!", Amonnam(mtmp),
* or
* <The/Your/Shk's container> is empty. Do what with it? [:irs nq or ?]
*/
- for (;;) { /* repeats iff '?' or ":' gets chosen */
+ for (;;) { /* repeats iff '?' or ':' gets chosen */
- outmaybe = (outokay || !current_container->cknown);
+ outmaybe = (outokay || !g.current_container->cknown);
if (!outmaybe)
(void) safe_qbuf(qbuf, (char *) 0, " is empty. Do what with it?",
- current_container, Yname2, Ysimple_name2,
+ g.current_container, Yname2, Ysimple_name2,
"This");
else
- (void) safe_qbuf(qbuf, "Do what with ", "?", current_container,
+ (void) safe_qbuf(qbuf, "Do what with ", "?", g.current_container,
yname, ysimple_name, "it");
/* ask player about what to do with this container */
if (flags.menu_style == MENU_PARTIAL
* which could be co-located and thus get restricted a bit too much.
* oh well.
*/
- if (mtmp != &g.youmonst && x == u.ux && y == u.uy
+ if (x == u.ux && y == u.uy
- && mtmp != &youmonst && (mtmp != u.ustuck || !u.uswallow)
++ && mtmp != &g.youmonst && (mtmp != u.ustuck || !u.uswallow)
&& (!u.usteed || mtmp != u.usteed))
return FALSE;
/* default to player's original monster type */
mdat = &mons[u.umonster];
}
- fakemon = zeromonst;
+ fakemon = cg.zeromonst;
set_mon_data(&fakemon, mdat); /* set up for goodpos */
+ /* used to use 'if (range > ROWNO && range > COLNO) return FALSE' below,
+ so effectively 'max(ROWNO, COLNO)' which performs useless iterations
+ (possibly many iterations if <xx,yy> is in the center of the map) */
+ xmax = max(xx - 1, (COLNO - 1) - xx);
+ ymax = max(yy - 0, (ROWNO - 1) - yy);
+ rangemax = max(xmax, ymax);
+ /* setup: no suitable spots yet, first iteration checks adjacent spots */
good_ptr = good;
range = 1;
/*
* we let negative values requests fall into the "heaven" loop.
*/
if (In_quest(&u.uz) && newlev > 0)
- newlev = newlev + dungeons[u.uz.dnum].depth_start - 1;
+ newlev = newlev + g.dungeons[u.uz.dnum].depth_start - 1;
} else { /* involuntary level tele */
- random_levtport:
+ random_levtport:
newlev = random_teleport_level();
if (newlev == depth(&u.uz)) {
You1(shudder_for_moment);