From 6886b199be7e1a18e6a3ba37dae2ffb9de62fd33 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Thu, 19 Mar 2026 00:58:21 +0000 Subject: [PATCH] Teleport traps don't teleport you on no-teleport levels In previous versions of NetHack, this wasn't a problem because teleport traps didn't *generate* on such levels, but more recent changes have made this situation possible (e.g. a demon lord migrates to a Gehennom filler level that already had a teleport trap on it). This change causes a "wrenching sensation", like stepping onto a teleport trap with magic resistance does. --- doc/fixes3-7-0.txt | 2 ++ src/teleport.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 82df2aec0..464e6e701 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2210,6 +2210,8 @@ 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 give a brief explanation when receiving a wish for acquiring the Amulet +teleportation traps no longer teleport you on levels made temporarily + no-teleport by the presence of a monster Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository diff --git a/src/teleport.c b/src/teleport.c index 48d3fd7dc..9858dfe49 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1494,7 +1494,7 @@ tele_trap(struct trap *trap) return; in_tele_trap = TRUE; - if (In_endgame(&u.uz) || Antimagic) { + if (In_endgame(&u.uz) || Antimagic || noteleport_level(&gy.youmonst)) { if (Antimagic) shieldeff(u.ux, u.uy); You_feel("a wrenching sensation.");