diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 2573be3bc..0f584ac0e 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -314,6 +314,7 @@ clairvoyance showed all monsters in range, then after player viewed the map, did a normal monster refresh; the 'I' glyph step clobbers remembered object at same spot, so skip it for locations where monster refresh is going to immediately redisplay a monster +take holes that you avoided into consideration when you're on the brink unix: fix double DLB definition in linux hints file windows: fix --showpaths output for the data file which relies on being constructed programmatically to incorporate the version suffix diff --git a/include/extern.h b/include/extern.h index 4f0eb794a..9c8de1b74 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2631,6 +2631,7 @@ E int FDECL(launch_obj, (SHORT_P, int, int, int, int, int)); E boolean NDECL(launch_in_progress); E void NDECL(force_launch_placement); E boolean FDECL(uteetering_at_seen_pit, (struct trap *)); +E boolean FDECL(uescaped_shaft, (struct trap *)); E boolean NDECL(lava_effects); E void NDECL(sink_into_lava); E void NDECL(sokoban_guilt); diff --git a/src/dig.c b/src/dig.c index 6bd239195..5548ce19c 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1167,7 +1167,7 @@ struct obj *obj; You("cannot stay under%s long enough.", is_pool(u.ux, u.uy) ? "water" : " the lava"); } else if ((trap = t_at(u.ux, u.uy)) != 0 - && uteetering_at_seen_pit(trap)) { + && (uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) { dotrap(trap, FORCEBUNGLE); /* might escape trap and still be teetering at brink */ if (!u.utrap) diff --git a/src/do.c b/src/do.c index 3cbab30d5..ccaf43dc7 100644 --- a/src/do.c +++ b/src/do.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 do.c $NHDT-Date: 1574722862 2019/11/25 23:01:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.193 $ */ +/* NetHack 3.6 do.c $NHDT-Date: 1575056306 2019/11/29 19:38:26 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.195 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -244,12 +244,13 @@ const char *verb; } return water_damage(obj, NULL, FALSE) == ER_DESTROYED; } else if (u.ux == x && u.uy == y && (t = t_at(x, y)) != 0 - && uteetering_at_seen_pit(t)) { + && (uteetering_at_seen_pit(t) || uescaped_shaft(t))) { if (Blind && !Deaf) You_hear("%s tumble downwards.", the(xname(obj))); else - pline("%s %s into %s pit.", The(xname(obj)), - otense(obj, "tumble"), the_your[t->madeby_u]); + pline("%s %s into %s %s.", The(xname(obj)), + otense(obj, "tumble"), the_your[t->madeby_u], + is_pit(t->ttyp) ? "pit" : "hole"); } else if (obj->globby) { /* Globby things like puddings might stick together */ while (obj && (otmp = obj_nexto_xy(obj, x, y, TRUE)) != 0) { @@ -996,7 +997,7 @@ dodown() } if (!stairs_down && !ladder_down) { trap = t_at(u.ux, u.uy); - if (trap && uteetering_at_seen_pit(trap)) { + if (trap && (uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) { dotrap(trap, TOOKPLUNGE); return 1; } else if (!trap || !is_hole(trap->ttyp) diff --git a/src/engrave.c b/src/engrave.c index 42cd49aa4..b50425cbf 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -156,7 +156,8 @@ boolean check_pit; if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) return FALSE; if (check_pit && !Flying - && (t = t_at(u.ux, u.uy)) != 0 && uteetering_at_seen_pit(t)) + && (t = t_at(u.ux, u.uy)) != 0 + && (uteetering_at_seen_pit(t) || uescaped_shaft(t))) return FALSE; return (boolean) ((!Levitation || Is_airlevel(&u.uz) diff --git a/src/hack.c b/src/hack.c index 5623efd8f..b220059b8 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2634,8 +2634,10 @@ pickup_checks() } if (!can_reach_floor(TRUE)) { struct trap *traphere = t_at(u.ux, u.uy); - if (traphere && uteetering_at_seen_pit(traphere)) - You("cannot reach the bottom of the pit."); + if (traphere + && (uteetering_at_seen_pit(traphere) || uescaped_shaft(traphere))) + You("cannot reach the bottom of the %s.", + is_pit(traphere->ttyp) ? "pit" : "abyss"); else if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) rider_cant_reach(); else if (Blind && !can_reach_floor(TRUE)) diff --git a/src/pickup.c b/src/pickup.c index cc793a66b..67921de6f 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -509,7 +509,7 @@ int what; /* should be a long */ if (!can_reach_floor(TRUE)) { if ((g.multi && !g.context.run) || (autopickup && !flags.pickup) || ((ttmp = t_at(u.ux, u.uy)) != 0 - && uteetering_at_seen_pit(ttmp))) + && (uteetering_at_seen_pit(ttmp) || uescaped_shaft(ttmp)))) read_engr_at(u.ux, u.uy); return 0; } diff --git a/src/sit.c b/src/sit.c index 7fd1b0764..1f0409f09 100644 --- a/src/sit.c +++ b/src/sit.c @@ -67,7 +67,7 @@ dosit() if (OBJ_AT(u.ux, u.uy) /* ensure we're not standing on the precipice */ - && !uteetering_at_seen_pit(trap)) { + && !(uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) { register struct obj *obj; obj = g.level.objects[u.ux][u.uy]; diff --git a/src/trap.c b/src/trap.c index 119589a47..c338d34a6 100644 --- a/src/trap.c +++ b/src/trap.c @@ -5083,11 +5083,21 @@ boolean uteetering_at_seen_pit(trap) struct trap *trap; { - if (trap && trap->tseen && (!u.utrap || u.utraptype != TT_PIT) - && is_pit(trap->ttyp)) - return TRUE; - else - return FALSE; + return (trap && is_pit(trap->ttyp) && trap->tseen + && trap->tx == u.ux && trap->ty == u.uy + && !(u.utrap && u.utraptype == TT_PIT)); +} + +/* + * Returns TRUE if you didn't fall through a hole or didn't + * release a trap door + */ +boolean +uescaped_shaft(trap) +struct trap *trap; +{ + return (trap && is_hole(trap->ttyp) && trap->tseen + && trap->tx == u.ux && trap->ty == u.uy); } /* Destroy a trap that emanates from the floor. */