]> granicus.if.org Git - nethack/commitdiff
#741 (from <Someone>)
authornethack.allison <nethack.allison>
Tue, 2 Apr 2002 01:26:25 +0000 (01:26 +0000)
committernethack.allison <nethack.allison>
Tue, 2 Apr 2002 01:26:25 +0000 (01:26 +0000)
Another fatal bug in win32 graphical interface
"Too many "dead" NHW_TEXT windows around. Repeating #? 15 times will produce
the same result."

>Wizard, wearing gray dragon scale mail and wielding Magicbane. The
>Dark One teleports next to me and I get the message "The Dark One
>casts a spell at you! A field of force surrounds you!". Then I get
>3 windows popping up: "Oops." "The dungeon collapses." "ERROR: No
>windows available..." and the game exits.

> I wish I could reproduce this reliably.  Here's the method I've been using
> to do it:
>
> - Equip character (+4 gdsm, Magicbane, unicorn horn, see invisible,
> telepathy, key, "gain ability" potions to max out, enhance dagger skill
> to max, level change to 14)
> - Teleport down to the portal entrance.  Go through the portal, get
> permission to go down to see the Dark One.
> - Go down to the Dark One's level, teleport over, open up his door, and
> basically just try to head back to the entrance and kill him.
>
> Two different things have happened while doing this so far.  (I've been
> able to get errors something like 5 times out of many tries, and I haven't
> been about to do it at all in the TTY version - only the windows
> one.)  Either I get the above message I mentioned to you, which seems to
> happen at a random time, or I get a slightly different result - "Oops,
> program initialization failed, ERROR: No windows available".  This second
> result happened once _after_ I had killed the Dark One and was trying to
> #quit.
>

win/win32/mhmenu.c
win/win32/mswproc.c

index 58f2ae62fee3ebc4751fe53fea96f0b63da15609..5bcb1f1b6e0d14a54a512672618143e572767081 100644 (file)
@@ -9,6 +9,7 @@
 #include "mhmain.h"
 #include "mhmsg.h"
 #include "mhfont.h"
+#include "mhdlg.h"
 
 #define MENU_MARGIN                    0
 #define NHMENU_STR_SIZE     BUFSZ
@@ -1038,7 +1039,10 @@ BOOL onListChar(HWND hWnd, HWND hwndList, WORD ch)
                        char buf[BUFSZ];
                        
                        reset_menu_count(hwndList, data);
-                       mswin_getlin("Search for:", buf);
+                       if( mswin_getlin_window("Search for:", buf, BUFSZ)==IDCANCEL ) {
+                               strcpy(buf, "\033");
+                       }
+                       SetFocus(hwndList);     // set focus back to the list control
                        if (!*buf || *buf == '\033') return -2;
                        for(i=0; i<data->menu.size; i++ ) {
                                if( NHMENU_IS_SELECTABLE(data->menu.items[i])
index f08404e64c3fdc0cc528555880ad6116a004fb86..724ad0f8485114ba453353cc275078c0b58ad6e3 100644 (file)
@@ -882,11 +882,6 @@ void mswin_destroy_nhwindow(winid wid)
                return;
     }
 
-       if (GetNHApp()->windowlist[wid].type == NHW_TEXT) {
-               /* this type takes care of themself */
-               return;
-       }
-
     if (wid != -1) {
                if( !GetNHApp()->windowlist[wid].dead &&
                        GetNHApp()->windowlist[wid].win != NULL )