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.
>
#include "mhmain.h"
#include "mhmsg.h"
#include "mhfont.h"
+#include "mhdlg.h"
#define MENU_MARGIN 0
#define NHMENU_STR_SIZE BUFSZ
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])
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 )