]> granicus.if.org Git - nethack/commitdiff
occupation vs running
authorPatR <rankin@nethack.org>
Mon, 28 Dec 2015 23:10:22 +0000 (15:10 -0800)
committerPatR <rankin@nethack.org>
Mon, 28 Dec 2015 23:10:22 +0000 (15:10 -0800)
Noticed while testing a potential change to running while confused:
when confusion timed out, I kept running even though I was headed in
the wrong direction.  Timeout calls stop_occupation() but running is
not an occupation.

Make stop_occupation() also stop counted activity under control of
the player (ie, multi > 0).  Some places in the code use both
stop_occuation() and nomul(0), some just use one or the other.  But
most of those probably intend for both.

src/allmain.c

index 02fa6480f9547c1892490967848c8920756868d7..9f4329143a3f9afa14feafdf4d209d6cc3db629d 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 allmain.c       $NHDT-Date: 1450231173 2015/12/16 01:59:33 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.67 $ */
+/* NetHack 3.6 allmain.c       $NHDT-Date: 1451344214 2015/12/28 23:10:14 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.68 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -296,10 +296,7 @@ boolean resuming;
                             change = 2;
                         if (change && !Unchanging) {
                             if (multi >= 0) {
-                                if (occupation)
-                                    stop_occupation();
-                                else
-                                    nomul(0);
+                                stop_occupation();
                                 if (change == 1)
                                     polyself(0);
                                 else
@@ -491,6 +488,8 @@ stop_occupation()
         context.botl = 1; /* in case u.uhs changed */
         nomul(0);
         pushch(0);
+    } else if (multi >= 0) {
+        nomul(0);
     }
 }