]> granicus.if.org Git - nethack/commitdiff
changing level workaround (C341-13)
authorcohrs <cohrs>
Sat, 25 Oct 2003 19:28:54 +0000 (19:28 +0000)
committercohrs <cohrs>
Sat, 25 Oct 2003 19:28:54 +0000 (19:28 +0000)
Use a new flush_screen(-1) call to toggle 3rd screen update in goto_level.
This keeps the 3rd screen state unchanged, no matter what happens at higher
levels, ensures the map window cursor stays on the hero, ensures the
hero's showrace colors remains bright white, and so on.

doc/fixes34.3
src/display.c
src/do.c

index 13a7bedfe5b763adb80513889e49a9fbca5ff518..6d54eec2e70ec8b242837e75f039ee68c69f5968 100644 (file)
@@ -81,6 +81,7 @@ when polymorphed into a quantum mechanic on a no teleport level and swallowed,
 allow Conflict-resistant monsters to respond to conflict attacks rather than
        sitting there and taking the attacks until they die
 prefer herbivorous stone-to-flesh message when hero is a vegitarian
+try even harder to avoid incorrect map display while changing levels
 
 
 Platform- and/or Interface-Specific Fixes
index 31012e3acc6d05923fb2976a5be9155eade8fcd8..3990cc6d9060bd45549e5206e2c60dbaf1660152 100644 (file)
@@ -1346,8 +1346,11 @@ flush_screen(cursor_on_u)
      *     flush_screen->print_glyph->impossible->pline->flush_screen
      */
     static   boolean flushing = 0;
+    static   boolean delay_flushing = 0;
     register int x,y;
 
+    if (cursor_on_u == -1) delay_flushing = !delay_flushing;
+    if (delay_flushing) return;
     if (flushing) return;      /* if already flushing then return */
     flushing = 1;
 
index 0031e62a5a45a40547a0c1486ee19d18079dfd93..80ea458113bf191a505107d7f9897b1d6b2168f3 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -1094,6 +1094,7 @@ boolean at_stairs, falling, portal;
        /* do this prior to level-change pline messages */
        vision_reset();         /* clear old level's line-of-sight */
        vision_full_recalc = 0; /* don't let that reenable vision yet */
+       flush_screen(-1);       /* ensure all map flushes are postponed */
 
        if (portal && !In_endgame(&u.uz)) {
            /* find the portal on the new level */
@@ -1243,7 +1244,7 @@ boolean at_stairs, falling, portal;
        /* Reset the screen. */
        vision_reset();         /* reset the blockages */
        docrt();                /* does a full vision recalc */
-       flush_screen(1);
+       flush_screen(-1);
 
        /*
         *  Move all plines beyond the screen reset.