]> granicus.if.org Git - nethack/commitdiff
wizard mode ^T
authorPatR <rankin@nethack.org>
Thu, 29 Jul 2021 17:25:18 +0000 (10:25 -0700)
committerPatR <rankin@nethack.org>
Thu, 29 Jul 2021 17:25:18 +0000 (10:25 -0700)
Noticed while testing the stair labeling, knowing the teleport away
spell (and without innate teleport ability--not sure whether that's
a factor), using ^T always attempted to cast the spell, even if you
used m^T to explicitly request wizard mode telport on demand.  Since
my samurai had no chance to cast such a high level spell, I couldn't
use ^T any more.

With a different character, I ended up with 15(2) energy after a ^T
attempt failed.  I've put in a fix for this but after the other one
I don't think it matters.

doc/fixes37.0
src/teleport.c

index b40f69fb0164cf7c094cbe47d1a5cdee36d0ed5a..c84c3a7b5907e65cab7c166b6a878ce954ca15ce 100644 (file)
@@ -578,6 +578,8 @@ monsters that drowned would never leave a corpse (holdover from decades ago
 give alternate message if hero is blind when throne gives "your vision clears"
 monster wearing an alchemy smock was only getting poison resistance from it,
        not acid resistance; give both properties, just like for hero
+in wizard mode, knowing teleport away spell resulted in ^T always attempting
+       the spell instead of teleporting on demand
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index f79ddd1477928d76c16bded8fcc9cdfe6c5f0e2e..27e94290fb9be52003c851ecee733dda336c9b24 100644 (file)
@@ -697,7 +697,7 @@ dotele(
         } else
             trap = 0;
     }
-    if (!trap) {
+    if (!trap && !break_the_rules) {
         boolean castit = FALSE;
         register int sp_no = 0, energy = 0;
 
@@ -737,7 +737,7 @@ dotele(
                the extra energy is spent even if that results in not
                having enough to cast (which also uses the move) */
             else if (u.uen < energy)
-                u.uen = energy;
+                energy = u.uen;
         } else if (u.uhunger <= 10) {
             cantdoit = "are too weak from hunger";
         } else if (ACURR(A_STR) < 4) {