diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 66ab95b39..3d0fd6f67 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1580 $ $NHDT-Date: 1764109066 2025/11/25 22:17:46 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1614 $ $NHDT-Date: 1769342601 2026/01/25 04:03:21 $ General Fixes and Modified Features ----------------------------------- @@ -2201,6 +2201,7 @@ when reading a T-shirt or apron, add trailing period to the slogan unless already present in the quoted text when reading an engraving, suppress the addition of a trailing period if the text already has one +cursed magic whistle could teleport hero on no-teleport levels Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository diff --git a/src/apply.c b/src/apply.c index c33b5d929..6cbcb30a8 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 apply.c $NHDT-Date: 1753856387 2025/07/29 22:19:47 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.472 $ */ +/* NetHack 3.7 apply.c $NHDT-Date: 1769342601 2026/01/25 04:03:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.475 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -500,7 +500,7 @@ use_magic_whistle(struct obj *obj) You("produce a %shigh-%s.", Underwater ? "very " : "", Deaf ? "frequency vibration" : "pitched humming noise"); wake_nearby(TRUE); - if (!rn2(2)) + if (!rn2(2) && !noteleport_level(&gy.youmonst)) tele_to_rnd_pet(); } else { /* it's magic! it works underwater too (at a higher pitch) */ diff --git a/src/teleport.c b/src/teleport.c index 535970dce..48d3fd7dc 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 teleport.c $NHDT-Date: 1736129950 2025/01/05 18:19:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.235 $ */ +/* NetHack 3.7 teleport.c $NHDT-Date: 1769342601 2026/01/25 04:03:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.239 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -811,6 +811,12 @@ tele_to_rnd_pet(void) struct monst *mtmp, *pet = (struct monst *) 0; int cnt = 0; + if (noteleport_level(&gy.youmonst)) { + impossible("%s", "attempt to teleport hero to be near a pet" + " on no-teleport level"); + return; + } + for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) if (!DEADMONSTER(mtmp) && mtmp->mtame && !mon_offmap(mtmp)) { cnt++;