botl update for trapped/untrapped
Make set_utrap() set context.botl when changing between untrapped and trapped or vice versa.
This commit is contained in:
+5
-3
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 hack.c $NHDT-Date: 1581886860 2020/02/16 21:01:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.248 $ */
|
/* NetHack 3.6 hack.c $NHDT-Date: 1582799171 2020/02/27 10:26:11 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.249 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -1749,8 +1749,10 @@ domove_core()
|
|||||||
if (u.utrap) {
|
if (u.utrap) {
|
||||||
boolean moved = trapmove(x, y, trap);
|
boolean moved = trapmove(x, y, trap);
|
||||||
|
|
||||||
if (!u.utrap)
|
if (!u.utrap) {
|
||||||
|
g.context.botl = TRUE;
|
||||||
reset_utrap(TRUE); /* might resume levitation or flight */
|
reset_utrap(TRUE); /* might resume levitation or flight */
|
||||||
|
}
|
||||||
/* might not have escaped, or did escape but remain in same spot */
|
/* might not have escaped, or did escape but remain in same spot */
|
||||||
if (!moved)
|
if (!moved)
|
||||||
return;
|
return;
|
||||||
@@ -1965,7 +1967,7 @@ domove_core()
|
|||||||
/* display every step or every 7th step depending upon mode */
|
/* display every step or every 7th step depending upon mode */
|
||||||
if (flags.runmode != RUN_LEAP || !(g.moves % 7L)) {
|
if (flags.runmode != RUN_LEAP || !(g.moves % 7L)) {
|
||||||
if (flags.time)
|
if (flags.time)
|
||||||
g.context.botl = 1;
|
iflags.time_botl = 1;
|
||||||
curs_on_u();
|
curs_on_u();
|
||||||
delay_output();
|
delay_output();
|
||||||
if (flags.runmode == RUN_CRAWL) {
|
if (flags.runmode == RUN_CRAWL) {
|
||||||
|
|||||||
+10
-3
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 trap.c $NHDT-Date: 1581886868 2020/02/16 21:01:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.351 $ */
|
/* NetHack 3.6 trap.c $NHDT-Date: 1582799195 2020/02/27 10:26:35 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.353 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -326,8 +326,9 @@ int x, y, typ;
|
|||||||
if (u.utrap && x == u.ux && y == u.uy
|
if (u.utrap && x == u.ux && y == u.uy
|
||||||
&& ((u.utraptype == TT_BEARTRAP && typ != BEAR_TRAP)
|
&& ((u.utraptype == TT_BEARTRAP && typ != BEAR_TRAP)
|
||||||
|| (u.utraptype == TT_WEB && typ != WEB)
|
|| (u.utraptype == TT_WEB && typ != WEB)
|
||||||
|| (u.utraptype == TT_PIT && !is_pit(typ))))
|
|| (u.utraptype == TT_PIT && !is_pit(typ))
|
||||||
u.utrap = 0;
|
|| (u.utraptype == TT_LAVA && !is_lava(x, y))))
|
||||||
|
reset_utrap(FALSE);
|
||||||
/* old <tx,ty> remain valid */
|
/* old <tx,ty> remain valid */
|
||||||
} else if (IS_FURNITURE(lev->typ)
|
} else if (IS_FURNITURE(lev->typ)
|
||||||
&& (!IS_GRAVE(lev->typ) || (typ != PIT && typ != HOLE))) {
|
&& (!IS_GRAVE(lev->typ) || (typ != PIT && typ != HOLE))) {
|
||||||
@@ -866,6 +867,12 @@ void
|
|||||||
set_utrap(tim, typ)
|
set_utrap(tim, typ)
|
||||||
unsigned tim, typ;
|
unsigned tim, typ;
|
||||||
{
|
{
|
||||||
|
/* if we get here through reset_utrap(), the caller of that might
|
||||||
|
have already set u.utrap to 0 so this check won't be sufficient
|
||||||
|
in that situation; caller will need to set context.botl itself */
|
||||||
|
if (!u.utrap ^ !tim)
|
||||||
|
g.context.botl = TRUE;
|
||||||
|
|
||||||
u.utrap = tim;
|
u.utrap = tim;
|
||||||
/* FIXME:
|
/* FIXME:
|
||||||
* utraptype==0 is bear trap rather than 'none'; we probably ought
|
* utraptype==0 is bear trap rather than 'none'; we probably ought
|
||||||
|
|||||||
Reference in New Issue
Block a user