]> granicus.if.org Git - nethack/commitdiff
level teleport "you materialize" mesg sequencing
authorPatR <rankin@nethack.org>
Tue, 28 Jan 2020 23:28:31 +0000 (15:28 -0800)
committerPatR <rankin@nethack.org>
Tue, 28 Jan 2020 23:28:31 +0000 (15:28 -0800)
If level teleport took you somewhere special, things like shop entry
or quest summons or valley atmosphere messages were being given first,
then "you materialize on a different level" after.  schedule_goto()
takes before-change-message and after-change-message arguments; it
ought to be extended to have a mid-change-message one too but I didn't
think of that until just now.

doc/fixes37.0
src/do.c

index 87f07e67f18a74c0de096a883fb40d24d9455564..c6de9e03b8a95bd7a37ef2f27e7a9248642b950a 100644 (file)
@@ -1,4 +1,4 @@
-$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.79 $ $NHDT-Date: 1580252492 2020/01/28 23:01:32 $
+$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.80 $ $NHDT-Date: 1580254093 2020/01/28 23:28:13 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -76,6 +76,8 @@ data.base lookup of an entry with any blank lines would falsely claim that
        "'data' file in wrong fromat or corrupted" after some extra checks
        were added while investigating tab handling anomalies
 using nhl_error() to report a Lua processing problem would clobber the stack
+level teleporation's "You materialize on a different level!" could be given
+       out of sequence with other arrival messages
 
 
 Platform- and/or Interface-Specific Fixes
index 0f0a08a305938652526c1503410d9e41c06e603f..69734ed6c308cee35ba3dc5288ea1b67f40d98bc 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -1,4 +1,4 @@
-/* NetHack 3.6 do.c    $NHDT-Date: 1577063925 2019/12/23 01:18:45 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.220 $ */
+/* NetHack 3.6 do.c    $NHDT-Date: 1580254093 2020/01/28 23:28:13 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.221 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Derek S. Ray, 2015. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1615,6 +1615,13 @@ boolean at_stairs, falling, portal;
      *  Move all plines beyond the screen reset.
      */
 
+    /* deferred arrival message for level teleport looks odd if given
+       after the various messages below so give it before them */
+    if (g.dfr_post_msg && !strncmpi(g.dfr_post_msg, "You materialize", 15)) {
+        pline("%s", g.dfr_post_msg);
+        free((genericptr_t) g.dfr_post_msg), g.dfr_post_msg = 0;
+    }
+
     /* special levels can have a custom arrival message */
     deliver_splev_message();
 
@@ -1699,9 +1706,11 @@ boolean at_stairs, falling, portal;
                  || g.quest_status.leader_is_dead)) {
             if (!u.uevent.qcalled) {
                 u.uevent.qcalled = 1;
-                com_pager("quest_portal"); /* main "leader needs help" message */
-            } else {          /* reminder message */
-                com_pager(Role_if(PM_ROGUE) ? "quest_portal_demand" : "quest_portal_again");
+                /* main "leader needs help" message */
+                com_pager("quest_portal");
+            } else { /* reminder message */
+                com_pager(Role_if(PM_ROGUE) ? "quest_portal_demand"
+                                            : "quest_portal_again");
             }
         }
     }