]> granicus.if.org Git - nethack/commitdiff
monster level teleporting fix
authornethack.rankin <nethack.rankin>
Tue, 12 Aug 2003 06:54:39 +0000 (06:54 +0000)
committernethack.rankin <nethack.rankin>
Tue, 12 Aug 2003 06:54:39 +0000 (06:54 +0000)
     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
src/teleport.c

index 625b9c953ac0b4ad61b4f09ebd1598cd5c5284fa..72bed2a1488955ae64a16181d9073ab4fa53a3d3 100644 (file)
@@ -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
index a65731bb11081793501a9a6faaf90eb887742e17..83edabefcdd80044109eef204d7ae0e961938958 100644 (file)
@@ -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 */