Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-12-10 09:18:20 -05:00
35 changed files with 1685 additions and 419 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 apply.c $NHDT-Date: 1542765339 2018/11/21 01:55:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.254 $ */
/* NetHack 3.6 apply.c $NHDT-Date: 1544442708 2018/12/10 11:51:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.269 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -418,7 +418,7 @@ register struct obj *obj;
return res;
case SCORR:
You_hear(hollow_str, "passage");
lev->typ = CORR;
lev->typ = CORR, lev->flags = 0;
unblock_point(rx, ry);
feel_newsym(rx, ry);
return res;
@@ -3394,7 +3394,7 @@ struct obj *obj;
*/
typ = fillholetyp(x, y, FALSE);
if (typ != ROOM) {
levl[x][y].typ = typ;
levl[x][y].typ = typ, levl[x][y].flags = 0;
liquid_flow(x, y, typ, t_at(x, y),
fillmsg
? (char *) 0

View File

@@ -234,7 +234,8 @@ do_statusline2()
void
bot()
{
if (youmonst.data && iflags.status_updates) {
/* dosave() flags completion by setting u.uhp to -1 */
if ((u.uhp != -1) && youmonst.data && iflags.status_updates) {
#ifdef STATUS_HILITES
bot_via_windowport();
#else

View File

@@ -17,6 +17,7 @@ int locknum = 0; /* max num of simultaneous users */
#ifdef DEF_PAGER
char *catmore = 0; /* default pager */
#endif
char chosen_windowtype[WINTYPELEN];
NEARDATA int bases[MAXOCLASSES] = DUMMY;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 detect.c $NHDT-Date: 1542853884 2018/11/22 02:31:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.87 $ */
/* NetHack 3.6 detect.c $NHDT-Date: 1544437284 2018/12/10 10:21:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.91 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1308,7 +1308,8 @@ struct obj *sobj; /* scroll--actually fake spellbook--object */
struct obj *otmp;
long save_EDetect_mons;
char save_viz_uyux;
boolean unconstrained, refresh = FALSE, mdetected = FALSE,
boolean unconstrained, refresh = FALSE,
mdetected = FALSE, odetected = FALSE,
/* fake spellbook 'sobj' implies hero has cast the spell;
when book is blessed, casting is skilled or expert level;
if already clairvoyant, non-skilled spell acts like skilled */
@@ -1363,6 +1364,10 @@ struct obj *sobj; /* scroll--actually fake spellbook--object */
if (extended)
otmp->dknown = 1;
map_object(otmp, TRUE);
newglyph = glyph_at(zx, zy);
/* if otmp is underwater, we'll need to redisplay the water */
if (newglyph != oldglyph && covers_objects(zx, zy))
odetected = TRUE;
}
/* if there is a monster here, see or detect it,
possibly as "remembered, unseen monster" */
@@ -1385,7 +1390,7 @@ struct obj *sobj; /* scroll--actually fake spellbook--object */
}
}
if (!level.flags.hero_memory || unconstrained || mdetected) {
if (!level.flags.hero_memory || unconstrained || mdetected || odetected) {
flush_screen(1); /* flush temp screen */
/* the getpos() prompt from browse_map() is only shown when
flags.verbose is set, but make this unconditional so that

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 dig.c $NHDT-Date: 1542765354 2018/11/21 01:55:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.115 $ */
/* NetHack 3.6 dig.c $NHDT-Date: 1544442710 2018/12/10 11:51:50 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.116 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -81,7 +81,7 @@ boolean waslit, rockit;
lev->horizontal = FALSE;
/* short-circuit vision recalc */
viz_array[y][x] = (dist < 3) ? (IN_SIGHT | COULD_SEE) : COULD_SEE;
lev->typ = (rockit ? STONE : ROOM);
lev->typ = (rockit ? STONE : ROOM); /* flags set via doormask above */
if (dist >= 3)
impossible("mkcavepos called with dist %d", dist);
feel_newsym(x, y);
@@ -129,7 +129,7 @@ register boolean rockit;
}
if (!rockit && levl[u.ux][u.uy].typ == CORR) {
levl[u.ux][u.uy].typ = ROOM;
levl[u.ux][u.uy].typ = ROOM; /* flags for CORR already 0 */
if (waslit)
levl[u.ux][u.uy].waslit = TRUE;
newsym(u.ux, u.uy); /* in case player is invisible */
@@ -361,9 +361,9 @@ dig(VOID_ARGS)
}
if (context.digging.effort > 100) {
register const char *digtxt, *dmgtxt = (const char *) 0;
register struct obj *obj;
register boolean shopedge = *in_rooms(dpx, dpy, SHOPBASE);
const char *digtxt, *dmgtxt = (const char *) 0;
struct obj *obj;
boolean shopedge = *in_rooms(dpx, dpy, SHOPBASE);
if ((obj = sobj_at(STATUE, dpx, dpy)) != 0) {
if (break_statue(obj))
@@ -397,12 +397,12 @@ dig(VOID_ARGS)
}
if (IS_TREE(lev->typ)) {
digtxt = "You cut down the tree.";
lev->typ = ROOM;
lev->typ = ROOM, lev->flags = 0;
if (!rn2(5))
(void) rnd_treefruit_at(dpx, dpy);
} else {
digtxt = "You succeed in cutting away some rock.";
lev->typ = CORR;
lev->typ = CORR, lev->flags = 0;
}
} else if (IS_WALL(lev->typ)) {
if (shopedge) {
@@ -410,12 +410,11 @@ dig(VOID_ARGS)
dmgtxt = "damage";
}
if (level.flags.is_maze_lev) {
lev->typ = ROOM;
lev->typ = ROOM, lev->flags = 0;
} else if (level.flags.is_cavernous_lev && !in_town(dpx, dpy)) {
lev->typ = CORR;
lev->typ = CORR, lev->flags = 0;
} else {
lev->typ = DOOR;
lev->doormask = D_NODOOR;
lev->typ = DOOR, lev->doormask = D_NODOOR;
}
digtxt = "You make an opening in the wall.";
} else if (lev->typ == SDOOR) {
@@ -573,6 +572,7 @@ int ttyp;
} else if (lev->typ == DRAWBRIDGE_DOWN
|| (is_drawbridge_wall(x, y) >= 0)) {
int bx = x, by = y;
/* if under the portcullis, the bridge is adjacent */
(void) find_drawbridge(&bx, &by);
destroy_drawbridge(bx, by);
@@ -853,6 +853,7 @@ coord *cc;
} else {
typ = fillholetyp(dig_x, dig_y, FALSE);
lev->flags = 0;
if (typ != ROOM) {
lev->typ = typ;
liquid_flow(dig_x, dig_y, typ, ttmp,
@@ -935,7 +936,7 @@ coord *cc;
pline_The("grave seems unused. Strange....");
break;
}
levl[dig_x][dig_y].typ = ROOM;
levl[dig_x][dig_y].typ = ROOM, levl[dig_x][dig_y].flags = 0;
del_engr_at(dig_x, dig_y);
newsym(dig_x, dig_y);
return;
@@ -1272,7 +1273,7 @@ register struct monst *mtmp;
newsym(mtmp->mx, mtmp->my);
return FALSE;
} else if (here->typ == SCORR) {
here->typ = CORR;
here->typ = CORR, here->flags = 0;
unblock_point(mtmp->mx, mtmp->my);
newsym(mtmp->mx, mtmp->my);
draft_message(FALSE); /* "You feel a draft." */
@@ -1297,20 +1298,19 @@ register struct monst *mtmp;
if (*in_rooms(mtmp->mx, mtmp->my, SHOPBASE))
add_damage(mtmp->mx, mtmp->my, 0L);
if (level.flags.is_maze_lev) {
here->typ = ROOM;
here->typ = ROOM, here->flags = 0;
} else if (level.flags.is_cavernous_lev
&& !in_town(mtmp->mx, mtmp->my)) {
here->typ = CORR;
here->typ = CORR, here->flags = 0;
} else {
here->typ = DOOR;
here->doormask = D_NODOOR;
here->typ = DOOR, here->doormask = D_NODOOR;
}
} else if (IS_TREE(here->typ)) {
here->typ = ROOM;
here->typ = ROOM, here->flags = 0;
if (pile && pile < 5)
(void) rnd_treefruit_at(mtmp->mx, mtmp->my);
} else {
here->typ = CORR;
here->typ = CORR, here->flags = 0;
if (pile && pile < 5)
(void) mksobj_at((pile == 1) ? BOULDER : ROCK, mtmp->mx, mtmp->my,
TRUE, FALSE);
@@ -1495,7 +1495,7 @@ zap_dig()
shopdoor = TRUE;
}
if (room->typ == SDOOR)
room->typ = DOOR;
room->typ = DOOR; /* doormask set below */
else if (cansee(zx, zy))
pline_The("door is razed!");
watch_dig((struct monst *) 0, zx, zy, TRUE);
@@ -1511,21 +1511,21 @@ zap_dig()
add_damage(zx, zy, SHOP_WALL_COST);
shopwall = TRUE;
}
room->typ = ROOM;
room->typ = ROOM, room->flags = 0;
unblock_point(zx, zy); /* vision */
} else if (!Blind)
pline_The("wall glows then fades.");
break;
} else if (IS_TREE(room->typ)) { /* check trees before stone */
if (!(room->wall_info & W_NONDIGGABLE)) {
room->typ = ROOM;
room->typ = ROOM, room->flags = 0;
unblock_point(zx, zy); /* vision */
} else if (!Blind)
pline_The("tree shudders but is unharmed.");
break;
} else if (room->typ == STONE || room->typ == SCORR) {
if (!(room->wall_info & W_NONDIGGABLE)) {
room->typ = CORR;
room->typ = CORR, room->flags = 0;
unblock_point(zx, zy); /* vision */
} else if (!Blind)
pline_The("rock glows then fades.");
@@ -1541,17 +1541,16 @@ zap_dig()
}
watch_dig((struct monst *) 0, zx, zy, TRUE);
if (level.flags.is_cavernous_lev && !in_town(zx, zy)) {
room->typ = CORR;
room->typ = CORR, room->flags = 0;
} else {
room->typ = DOOR;
room->doormask = D_NODOOR;
room->typ = DOOR, room->doormask = D_NODOOR;
}
digdepth -= 2;
} else if (IS_TREE(room->typ)) {
room->typ = ROOM;
room->typ = ROOM, room->flags = 0;
digdepth -= 2;
} else { /* IS_ROCK but not IS_WALL or SDOOR */
room->typ = CORR;
room->typ = CORR, room->flags = 0;
digdepth--;
}
unblock_point(zx, zy); /* vision */
@@ -1563,8 +1562,10 @@ zap_dig()
if (pitflow && isok(flow_x, flow_y)) {
struct trap *ttmp = t_at(flow_x, flow_y);
if (ttmp && is_pit(ttmp->ttyp)) {
schar filltyp = fillholetyp(ttmp->tx, ttmp->ty, TRUE);
if (filltyp != ROOM)
pit_flow(ttmp, filltyp);
}
@@ -1589,7 +1590,7 @@ char *msg;
int ltyp;
struct rm *room;
const char *foundation_msg =
"The foundation is too hard to dig through from this angle.";
"The foundation is too hard to dig through from this angle.";
if (!cc)
return FALSE;
@@ -1597,7 +1598,7 @@ char *msg;
return FALSE;
*msg = '\0';
room = &levl[cc->x][cc->y];
ltyp = room->typ;
ltyp = room->typ, room->flags = 0;
if (is_pool(cc->x, cc->y) || is_lava(cc->x, cc->y)) {
/* this is handled by the caller after we return FALSE */
@@ -1677,15 +1678,14 @@ pit_flow(trap, filltyp)
struct trap *trap;
schar filltyp;
{
if (trap && (filltyp != ROOM)
&& is_pit(trap->ttyp)) {
if (trap && filltyp != ROOM && is_pit(trap->ttyp)) {
struct trap t;
int idx;
t = *trap;
levl[trap->tx][trap->ty].typ = filltyp;
liquid_flow(trap->tx, trap->ty, filltyp, trap,
(trap->tx == u.ux && trap->ty == u.uy)
levl[t.tx][t.ty].typ = filltyp, levl[t.tx][t.ty].flags = 0;
liquid_flow(t.tx, t.ty, filltyp, trap,
(t.tx == u.ux && t.ty == u.uy)
? "Suddenly %s flows in from the adjacent pit!"
: (char *) 0);
for (idx = 0; idx < 8; ++idx) {

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do.c $NHDT-Date: 1543972190 2018/12/05 01:09:50 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.176 $ */
/* NetHack 3.6 do.c $NHDT-Date: 1544442710 2018/12/10 11:51:50 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.177 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -67,7 +67,7 @@ boolean pushing;
levl[rx][ry].drawbridgemask &= ~DB_UNDER; /* clear lava */
levl[rx][ry].drawbridgemask |= DB_FLOOR;
} else
levl[rx][ry].typ = ROOM;
levl[rx][ry].typ = ROOM, levl[rx][ry].flags = 0;
if (ttmp)
(void) delfloortrap(ttmp);
@@ -276,22 +276,29 @@ STATIC_DCL void
polymorph_sink()
{
uchar sym = S_sink;
boolean sinklooted;
if (levl[u.ux][u.uy].typ != SINK)
return;
sinklooted = levl[u.ux][u.uy].looted != 0;
level.flags.nsinks--;
levl[u.ux][u.uy].doormask = 0;
levl[u.ux][u.uy].doormask = 0; /* levl[][].flags */
switch (rn2(4)) {
default:
case 0:
sym = S_fountain;
levl[u.ux][u.uy].typ = FOUNTAIN;
levl[u.ux][u.uy].blessedftn = 0;
if (sinklooted)
SET_FOUNTAIN_LOOTED(u.ux, u.uy);
level.flags.nfountains++;
break;
case 1:
sym = S_throne;
levl[u.ux][u.uy].typ = THRONE;
if (sinklooted)
levl[u.ux][u.uy].looted = T_LOOTED;
break;
case 2:
sym = S_altar;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 dothrow.c $NHDT-Date: 1543892215 2018/12/04 02:56:55 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.152 $ */
/* NetHack 3.6 dothrow.c $NHDT-Date: 1544401268 2018/12/10 00:21:08 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.153 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -707,6 +707,11 @@ int x, y;
newsym(ox, oy); /* update old position */
vision_recalc(1); /* update for new position */
flush_screen(1);
/* if terrain type changes, levitation or flying might become blocked
or unblocked; might issue message, so do this after map+vision has
been updated for new location instead of right after u_on_newpos() */
if (levl[u.ux][u.uy].typ != levl[ox][oy].typ)
switch_terrain();
if (is_pool(x, y) && !u.uinwater) {
if ((Is_waterlevel(&u.uz) && levl[x][y].typ == WATER)

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 fountain.c $NHDT-Date: 1455402364 2016/02/13 22:26:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.56 $ */
/* NetHack 3.6 fountain.c $NHDT-Date: 1544442711 2018/12/10 11:51:51 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.60 $ */
/* Copyright Scott R. Turner, srt@ucla, 10/27/86 */
/* NetHack may be freely redistributed. See license for details. */
@@ -137,7 +137,7 @@ genericptr_t poolcnt;
pline("Water gushes forth from the overflowing fountain!");
/* Put a pool at x, y */
levl[x][y].typ = POOL;
levl[x][y].typ = POOL, levl[x][y].flags = 0;
/* No kelp! */
del_engr_at(x, y);
water_damage_chain(level.objects[x][y], TRUE);
@@ -205,8 +205,7 @@ boolean isyou;
return;
}
/* replace the fountain with ordinary floor */
levl[x][y].typ = ROOM;
levl[x][y].looted = 0;
levl[x][y].typ = ROOM, levl[x][y].flags = 0;
levl[x][y].blessedftn = 0;
if (cansee(x, y))
pline_The("fountain dries up!");
@@ -397,8 +396,7 @@ register struct obj *obj;
exercise(A_WIS, TRUE);
}
update_inventory();
levl[u.ux][u.uy].typ = ROOM;
levl[u.ux][u.uy].looted = 0;
levl[u.ux][u.uy].typ = ROOM, levl[u.ux][u.uy].flags = 0;
newsym(u.ux, u.uy);
level.flags.nfountains--;
if (in_town(u.ux, u.uy))
@@ -511,8 +509,9 @@ int x, y;
if (cansee(x, y) || (x == u.ux && y == u.uy))
pline_The("pipes break! Water spurts out!");
level.flags.nsinks--;
levl[x][y].doormask = 0;
levl[x][y].typ = FOUNTAIN;
levl[x][y].typ = FOUNTAIN, levl[x][y].looted = 0;
levl[x][y].blessedftn = 0;
SET_FOUNTAIN_LOOTED(x, y);
level.flags.nfountains++;
newsym(x, y);
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 hack.c $NHDT-Date: 1543972190 2018/12/05 01:09:50 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.200 $ */
/* NetHack 3.6 hack.c $NHDT-Date: 1544401269 2018/12/10 00:21:09 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.201 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -13,7 +13,6 @@ STATIC_DCL int FDECL(still_chewing, (XCHAR_P, XCHAR_P));
STATIC_DCL void NDECL(dosinkfall);
STATIC_DCL boolean FDECL(findtravelpath, (int));
STATIC_DCL boolean FDECL(trapmove, (int, int, struct trap *));
STATIC_DCL void NDECL(switch_terrain);
STATIC_DCL struct monst *FDECL(monstinroom, (struct permonst *, int));
STATIC_DCL boolean FDECL(doorless_door, (int, int));
STATIC_DCL void FDECL(move_update, (BOOLEAN_P));
@@ -1935,12 +1934,13 @@ invocation_message()
/* moving onto different terrain;
might be going into solid rock, inhibiting levitation or flight,
or coming back out of such, reinstating levitation/flying */
STATIC_OVL void
void
switch_terrain()
{
struct rm *lev = &levl[u.ux][u.uy];
boolean blocklev = (IS_ROCK(lev->typ) || closed_door(u.ux, u.uy)
|| (Is_waterlevel(&u.uz) && lev->typ == WATER));
|| (Is_waterlevel(&u.uz) && lev->typ == WATER)),
was_levitating = !!Levitation, was_flying = !!Flying;
if (blocklev) {
/* called from spoteffects(), stop levitating but skip float_down() */
@@ -1968,6 +1968,8 @@ switch_terrain()
if (Flying)
You("start flying.");
}
if ((!Levitation ^ was_levitating) || (!Flying ^ was_flying))
context.botl = TRUE; /* update Lev/Fly status condition */
}
/* extracted from spoteffects; called by spoteffects to check for entering or
@@ -2828,12 +2830,13 @@ const char *msg_override;
else if (!nomovemsg)
nomovemsg = You_can_move_again;
if (*nomovemsg)
pline1(nomovemsg);
pline("%s", nomovemsg);
nomovemsg = 0;
u.usleep = 0;
multi_reason = NULL;
if (afternmv) {
int NDECL((*f)) = afternmv;
/* clear afternmv before calling it (to override the
encumbrance hack for levitation--see weight_cap()) */
afternmv = (int NDECL((*))) 0;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 lock.c $NHDT-Date: 1521499715 2018/03/19 22:48:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.80 $ */
/* NetHack 3.6 lock.c $NHDT-Date: 1544442712 2018/12/10 11:51:52 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.82 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -950,7 +950,7 @@ int x, y;
return FALSE;
}
block_point(x, y);
door->typ = SDOOR;
door->typ = SDOOR, door->doormask = D_NODOOR;
if (vis)
pline_The("doorway vanishes!");
newsym(x, y);

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 monmove.c $NHDT-Date: 1517877380 2018/02/06 00:36:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.96 $ */
/* NetHack 3.6 monmove.c $NHDT-Date: 1544442712 2018/12/10 11:51:52 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.109 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1474,6 +1474,7 @@ dissolve_bars(x, y)
register int x, y;
{
levl[x][y].typ = (Is_special(&u.uz) || *in_rooms(x, y, 0)) ? ROOM : CORR;
levl[x][y].flags = 0;
newsym(x, y);
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 music.c $NHDT-Date: 1542765361 2018/11/21 01:56:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.56 $ */
/* NetHack 3.6 music.c $NHDT-Date: 1544442713 2018/12/10 11:51:53 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.57 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
@@ -320,7 +320,7 @@ int force;
*/
filltype = fillholetyp(x, y, FALSE);
if (filltype != ROOM) {
levl[x][y].typ = filltype;
levl[x][y].typ = filltype; /* flags set via doormask */
liquid_flow(x, y, filltype, chasm, (char *) 0);
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 options.c $NHDT-Date: 1544174413 2018/12/07 09:20:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.339 $ */
/* NetHack 3.6 options.c $NHDT-Date: 1544396581 2018/12/09 23:03:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.340 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
@@ -20,7 +20,6 @@ NEARDATA struct instance_flags iflags; /* provide linkage */
#endif
#define BACKWARD_COMPAT
#define WINTYPELEN 16
#ifdef DEFAULT_WC_TILED_MAP
#define PREFER_TILED TRUE
@@ -873,16 +872,23 @@ initoptions_finish()
* A multi-interface binary might only support status highlighting
* for some of the interfaces; check whether we asked for it but are
* using one which doesn't.
*
* Option processing can take place before a user-decided WindowPort
* is even initialized, so check for that too.
*/
if (iflags.hilite_delta && !wc2_supported("statushilites")) {
raw_printf("Status highlighting not supported for %s interface.",
windowprocs.name);
iflags.hilite_delta = 0;
if (!WINDOWPORT("safe-startup")) {
if (iflags.hilite_delta && !wc2_supported("statushilites")) {
raw_printf("Status highlighting not supported for %s interface.",
windowprocs.name);
iflags.hilite_delta = 0;
}
}
#endif
return;
}
/* copy up to maxlen-1 characters; 'dest' must be able to hold maxlen;
treat comma as alternate end of 'src' */
STATIC_OVL void
nmcpy(dest, src, maxlen)
char *dest;
@@ -896,7 +902,7 @@ int maxlen;
break; /*exit on \0 terminator*/
*dest++ = *src++;
}
*dest = 0;
*dest = '\0';
}
/*
@@ -2583,7 +2589,7 @@ boolean tinitial, tfrom_file;
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, negated);
op = string_for_opt(opts, negated || !initial);
if (negated) {
if (op) {
bad_negation("fruit", TRUE);
@@ -2594,6 +2600,8 @@ boolean tinitial, tfrom_file;
}
if (!op)
return FALSE;
/* 3.6.2: strip leading and trailing spaces, condense internal ones */
mungspaces(op);
if (!initial) {
struct fruit *f;
int fnum = 0;
@@ -3514,10 +3522,14 @@ boolean tinitial, tfrom_file;
bad_negation(fullname, FALSE);
return FALSE;
} else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) {
char buf[WINTYPELEN];
if (!iflags.windowtype_deferred) {
char buf[WINTYPELEN];
nmcpy(buf, op, WINTYPELEN);
choose_windows(buf);
nmcpy(buf, op, WINTYPELEN);
choose_windows(buf);
} else {
nmcpy(chosen_windowtype, op, WINTYPELEN);
}
} else
return FALSE;
return retval;
@@ -4465,7 +4477,7 @@ doset() /* changing options via menu by Per Liboriussen */
/* boolean option */
Sprintf(buf, "%s%s", *boolopt[opt_indx].addr ? "!" : "",
boolopt[opt_indx].name);
parseoptions(buf, setinitial, fromfile);
(void) parseoptions(buf, setinitial, fromfile);
if (wc_supported(boolopt[opt_indx].name)
|| wc2_supported(boolopt[opt_indx].name))
preference_update(boolopt[opt_indx].name);
@@ -4481,7 +4493,7 @@ doset() /* changing options via menu by Per Liboriussen */
continue;
Sprintf(buf, "%s:%s", compopt[opt_indx].name, buf2);
/* pass the buck */
parseoptions(buf, setinitial, fromfile);
(void) parseoptions(buf, setinitial, fromfile);
}
if (wc_supported(compopt[opt_indx].name)
|| wc2_supported(compopt[opt_indx].name))
@@ -4639,7 +4651,8 @@ boolean setinitial, setfromfile;
destroy_nhwindow(tmpwin);
} else if (!strcmp("pickup_types", optname)) {
/* parseoptions will prompt for the list of types */
parseoptions(strcpy(buf, "pickup_types"), setinitial, setfromfile);
(void) parseoptions(strcpy(buf, "pickup_types"),
setinitial, setfromfile);
} else if (!strcmp("disclose", optname)) {
/* order of disclose_names[] must correspond to
disclosure_options in decl.c */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 sit.c $NHDT-Date: 1458341129 2016/03/18 22:45:29 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.53 $ */
/* NetHack 3.6 sit.c $NHDT-Date: 1544442714 2018/12/10 11:51:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.59 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -281,7 +281,7 @@ dosit()
if (!rn2(3) && IS_THRONE(levl[u.ux][u.uy].typ)) {
/* may have teleported */
levl[u.ux][u.uy].typ = ROOM;
levl[u.ux][u.uy].typ = ROOM, levl[u.ux][u.uy].flags = 0;
pline_The("throne vanishes in a puff of logic.");
newsym(u.ux, u.uy);
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 teleport.c $NHDT-Date: 1523306912 2018/04/09 20:48:32 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.73 $ */
/* NetHack 3.6 teleport.c $NHDT-Date: 1544401270 2018/12/10 00:21:10 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.81 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -340,6 +340,11 @@ boolean allow_drag;
vision_full_recalc = 1;
nomul(0);
vision_recalc(0); /* vision before effects */
/* if terrain type changes, levitation or flying might become blocked
or unblocked; might issue message, so do this after map+vision has
been updated for new location instead of right after u_on_newpos() */
if (levl[u.ux][u.uy].typ != levl[u.ux0][u.uy0].typ)
switch_terrain();
if (telescroll) {
/* when teleporting by scroll, we need to handle discovery
now before getting feedback about any objects at our

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 zap.c $NHDT-Date: 1544230271 2018/12/08 00:51:11 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.301 $ */
/* NetHack 3.6 zap.c $NHDT-Date: 1544442714 2018/12/10 11:51:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.302 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -4374,7 +4374,7 @@ short exploding_wand_typ;
msgtxt = "Some water evaporates.";
} else {
rangemod -= 3;
lev->typ = ROOM;
lev->typ = ROOM, lev->flags = 0;
t = maketrap(x, y, PIT);
if (t)
t->tseen = 1;
@@ -4413,9 +4413,9 @@ short exploding_wand_typ;
lev->drawbridgemask &= ~DB_UNDER; /* clear lava */
lev->drawbridgemask |= (lava ? DB_FLOOR : DB_ICE);
} else {
if (!lava)
lev->icedpool = (lev->typ == POOL) ? ICED_POOL
: ICED_MOAT;
lev->icedpool = lava ? 0
: (lev->typ == POOL) ? ICED_POOL
: ICED_MOAT;
lev->typ = lava ? ROOM : ICE;
}
bury_objs(x, y);
@@ -4490,15 +4490,14 @@ short exploding_wand_typ;
Norep("The %s melt.", defsyms[S_bars].explanation);
if (*in_rooms(x, y, SHOPBASE)) {
/* in case we ever have a shop bounded by bars */
lev->typ = ROOM;
lev->typ = ROOM, lev->flags = 0;
if (see_it)
newsym(x, y);
add_damage(x, y, (type >= 0) ? SHOP_BARS_COST : 0L);
if (type >= 0)
*shopdamage = TRUE;
} else {
lev->typ = DOOR;
lev->doormask = D_NODOOR;
lev->typ = DOOR, lev->doormask = D_NODOOR;
if (see_it)
newsym(x, y);
}