allow teleport onto the vibrating square

Cherry-pick 3.7.0's 4a3d5f95d9
(github pull request #252).  Slightly tricky because the fix entry
nowgoes into a different file.  fixes37.0 will need fixing up.
This commit is contained in:
PatR
2019-12-13 15:58:56 -08:00
parent 62c271f21b
commit f8fbe4e989
2 changed files with 10 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 teleport.c $NHDT-Date: 1575245091 2019/12/02 00:04:51 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.94 $ */
/* NetHack 3.6 teleport.c $NHDT-Date: 1576281515 2019/12/13 23:58:35 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.95 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -263,8 +263,13 @@ teleok(x, y, trapok)
register int x, y;
boolean trapok;
{
if (!trapok && t_at(x, y))
return FALSE;
if (!trapok) {
/* allow teleportation onto vibrating square, it's not a real trap */
struct trap *trap = t_at(x, y);
if (trap && trap->ttyp != VIBRATING_SQUARE)
return FALSE;
}
if (!goodpos(x, y, &youmonst, 0))
return FALSE;
if (!tele_jump_ok(u.ux, u.uy, x, y))