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.
This commit is contained in:
Alex Smith
2026-03-19 00:58:21 +00:00
parent 85e3d721fb
commit 6886b199be
2 changed files with 3 additions and 1 deletions

View File

@@ -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.");