Skip to content

Commit

Permalink
dungeon open failure
Browse files Browse the repository at this point in the history
We've been getting numerous complaints from people
about "dungeon failure", often related to attempts
to start NetHack from within various zip utilities
that present a folder-like view.

The dungeon failure was actually misleading. The
real problem was a dlb file open failure, but the
return value of dlb_init() was not being checked
in pcmain.

This moves the dlb_init earlier in the startup,
checks for failure, and provides some feedback
around the common zip utility problem for win32.
  • Loading branch information
nethack.allison committed May 7, 2006
1 parent a71d270 commit 1a01343
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/fixes35.0
Expand Up @@ -203,6 +203,7 @@ some monsters can eat tins in addition to corpses to cure some ailments

Platform- and/or Interface-Specific New Features
------------------------------------------------
pcmain: check for dlb_init failure rather than relying on dungeon open failure
win32gui: support perm_invent
win32gui: menu option to add/remove windows captions
win32gui: support for saving/restoring message history
Expand Down
15 changes: 13 additions & 2 deletions sys/share/pcmain.c
Expand Up @@ -6,6 +6,7 @@

#include "hack.h"
#include "dlb.h"
#include "patchlevel.h"

#ifndef NO_SIGNAL
#include <signal.h>
Expand Down Expand Up @@ -271,6 +272,18 @@ char *argv[];
if (comp_times((long)time(&clock_time)))
error("Your clock is incorrectly set!");
#endif
if (!dlb_init()) {
pline("%s\n%s\n%s\n\nNetHack was unable to open the required file \"%s\".%s",
COPYRIGHT_BANNER_A, COPYRIGHT_BANNER_B,
COPYRIGHT_BANNER_C, DLBFILE,
#ifdef WIN32
"\nAre you perhaps trying to run NetHack within a zip utility?");
#else
"");
#endif
error("dlb_init failure.");
}

u.uhp = 1; /* prevent RIP on early quits */
u.ux = 0; /* prevent flush_screen() */

Expand Down Expand Up @@ -397,8 +410,6 @@ char *argv[];
*/
vision_init();

dlb_init();

display_gamewindows();
#ifdef WIN32
getreturn_enabled = TRUE;
Expand Down

0 comments on commit 1a01343

Please sign in to comment.