From fad1cd4b88aaf9eea87097553a327d8cde3e4e1a Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Tue, 12 Aug 2003 06:54:39 +0000 Subject: [PATCH] monster level teleporting fix From newsgroup discussion: prevent monsters from level teleporting to Moloch's Sanctum level unless the invocation ritual has already made it accessible (same restriction player's character already has). Otherwise a monster could pick up one of the invocation items and effectively take it into limbo, making it become impossible for the player to reach that level. --- doc/fixes34.2 | 1 + src/teleport.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 625b9c953..72bed2a14 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -84,6 +84,7 @@ can no longer untrap floor containers during unskilled riding can no longer easily set land mines and bear traps during unskilled riding refine cmdassist handling for armor vs accessories prevent monsters from level teleporting out of the quest into the main dungeon +prevent monsters from level teleporting into the Sanctum prior to invocation "m," command sequence would let you see all objects at a location even when they included a cockatrice corpse which hero was unequipped to handle use correct pronoun for unique monsters diff --git a/src/teleport.c b/src/teleport.c index a65731bb1..83edabefc 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)teleport.c 3.4 2003/05/31 */ +/* SCCS Id: @(#)teleport.c 3.4 2003/08/11 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1196,10 +1196,13 @@ random_teleport_level() * --KAA * 3.4.2: explicitly handle quest here too, to fix the problem of * monsters sometimes level teleporting out of it into main dungeon. + * Also prevent monsters reaching the Sanctum prior to invocation. */ min_depth = In_quest(&u.uz) ? dungeons[u.uz.dnum].depth_start : 1; max_depth = dunlevs_in_dungeon(&u.uz) + (dungeons[u.uz.dnum].depth_start - 1); + /* can't reach the Sanctum if the invocation hasn't been performed */ + if (Inhell && !u.uevent.invoked) max_depth -= 1; /* Get a random value relative to the current dungeon */ /* Range is 1 to current+3, current not counting */ -- 2.40.0