blocking or unblocking levitation or flight
when level teleporting or digging. Level teleporting while levitation was blocked due to being inside solid rock didn't notice that it should be unblocked until you moved from whatever type of terrain you landed on (room, for instance) to some other type (such as corridor). Digging down to make a pit or hole while inside solid rock converts that spot to floor so should also check whether to unblock levitation/flying, and not fall if unblocking occurs.
This commit is contained in:
19
src/dig.c
19
src/dig.c
@@ -1,4 +1,4 @@
|
||||
/* 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 $ */
|
||||
/* NetHack 3.6 dig.c $NHDT-Date: 1547421446 2019/01/13 23:17:26 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.117 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -612,10 +612,16 @@ int ttyp;
|
||||
You("dig a pit in the %s.", surface_type);
|
||||
if (shopdoor)
|
||||
pay_for_damage("ruin", FALSE);
|
||||
} else if (!madeby_obj && canseemon(madeby))
|
||||
} else if (!madeby_obj && canseemon(madeby)) {
|
||||
pline("%s digs a pit in the %s.", Monnam(madeby), surface_type);
|
||||
else if (cansee(x, y) && flags.verbose)
|
||||
} else if (cansee(x, y) && flags.verbose) {
|
||||
pline("A pit appears in the %s.", surface_type);
|
||||
}
|
||||
/* in case we're digging down while encased in solid rock
|
||||
which is blocking levitation or flight */
|
||||
switch_terrain();
|
||||
if (Levitation || Flying)
|
||||
wont_fall = TRUE;
|
||||
|
||||
if (at_u) {
|
||||
if (!wont_fall) {
|
||||
@@ -644,6 +650,13 @@ int ttyp;
|
||||
pline("A hole appears in the %s.", surface_type);
|
||||
|
||||
if (at_u) {
|
||||
/* in case we're digging down while encased in solid rock
|
||||
which is blocking levitation or flight */
|
||||
switch_terrain();
|
||||
if (Levitation || Flying)
|
||||
wont_fall = TRUE;
|
||||
|
||||
/* check for leashed pet that can't fall right now */
|
||||
if (!u.ustuck && !wont_fall && !next_to_u()) {
|
||||
You("are jerked back by your pet!");
|
||||
wont_fall = TRUE;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 dungeon.c $NHDT-Date: 1523308357 2018/04/09 21:12:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.87 $ */
|
||||
/* NetHack 3.6 dungeon.c $NHDT-Date: 1547421449 2019/01/13 23:17:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.90 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1202,7 +1202,7 @@ int x, y;
|
||||
u.ux0 = u.ux, u.uy0 = u.uy;
|
||||
}
|
||||
|
||||
/* place you on a random location */
|
||||
/* place you on a random location when arriving on a level */
|
||||
void
|
||||
u_on_rndspot(upflag)
|
||||
int upflag;
|
||||
@@ -1230,6 +1230,9 @@ int upflag;
|
||||
place_lregion(dndest.lx, dndest.ly, dndest.hx, dndest.hy,
|
||||
dndest.nlx, dndest.nly, dndest.nhx, dndest.nhy,
|
||||
LR_DOWNTELE, (d_level *) 0);
|
||||
|
||||
/* might have just left solid rock and unblocked levitation */
|
||||
switch_terrain();
|
||||
}
|
||||
|
||||
/* place you on the special staircase */
|
||||
|
||||
Reference in New Issue
Block a user