Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!tikal!hplsla!ericb From: ericb@hplsla.HP.COM (Eric Backus) Newsgroups: comp.sources.bugs Subject: Re: NetHack Woes Message-ID: <5570001@hplsla.HP.COM> Date: 8 Dec 87 18:35:58 GMT References: <2361@killer.UUCP> Organization: HP Lake Stevens, WA Lines: 120 I just can't let this complaint go by. My machine runs HP-UX, which is System V with some added features. I was thoroughly impressed by how easy it was to get NetHack running. There is over a megabyte of source code here, designed on various different computers, and the designers probably have never even seen HP-UX! Mike and the rest have done an outstanding job. I, too, ran into the '$<50>' problem. I don't know what the 'correct' solution should be, but I have a nap routine which is like sleep except it does millisecond delays. I put this instead of the old stuff: fflush(stdout); nap(50); and now it works fine. If anyone out there want this nap routine, let me know. Other than the '$<50>' problem, my screen looks just fine. Note that even if you leave the code as-is, you can define 'nonull' in your HACKOPTIONS to avoid the messy output. I had to comment out the 'extern' part of the declaration of 'ospeed' in termcap.c. I don't know why, but it works. This is the ONLY other change I had to make to termcap.c. I ran into the 'You stop to avoid hitting .' problem, too. I solved it by removing the block of code that stops you from hitting your dog. I believe that this code should be removed anyway, since immediately after it there is some code that will ASK you if you really want to do that. I don't like being absolutely prevented from hitting my dog, even if it's unlucky to do it. Here's a context diff if anyone's interested: *** fight.c.orig Mon Dec 7 02:11:10 1987 --- fight.c Mon Dec 7 02:12:07 1987 *************** *** 460,465 * There is protection only if you're not blind, confused or * invisible. */ /* changes by wwp 5/16/85 */ if (!Blind && !Confusion && !Hallucination && mdat->mlet == 'd' && mtmp->mtame) { --- 460,466 ----- * There is protection only if you're not blind, confused or * invisible. */ + #ifdef unused /* changes by wwp 5/16/85 */ if (!Blind && !Confusion && !Hallucination && mdat->mlet == 'd' && mtmp->mtame) { *************** *** 472,477 pline("You stop to avoid hitting your dog."); return(TRUE); } if (flags.confirm && (mtmp->mpeaceful || mtmp->mtame) && ! Confusion && !Hallucination && !Invisible) --- 473,479 ----- pline("You stop to avoid hitting your dog."); return(TRUE); } + #endif unused if (flags.confirm && (mtmp->mpeaceful || mtmp->mtame) && ! Confusion && !Hallucination && !Invisible) I also had a problem with rnd.c. It uses 'random()' rather than 'rand()', which I believe is a bug. The file config.h sets up a definition of 'rand()' appropriate for whatever version of UNIX you have. Here's a context diff if anyone's interested: *** rnd.c.orig Mon Dec 7 01:06:33 1987 --- rnd.c Mon Dec 7 01:06:48 1987 *************** *** 2,8 */ #include "config.h" #ifdef UNIX ! #define RND(x) (random() % (x)) #else /* Good luck: the bottom order bits are cyclic. */ #define RND(x) ((rand()>>3) % (x)) --- 2,8 ----- */ #include "config.h" #ifdef UNIX ! #define RND(x) (rand() % (x)) #else /* Good luck: the bottom order bits are cyclic. */ #define RND(x) ((rand()>>3) % (x)) Finally, I have a couple minor bug reports/enhancement requests: 1) Currently, the Makefile sets up the nethack directory as readable by anyone. This seems like it encourages people to copy save files, to read the rumors file, and to do a 'strings nethack' to figure out what's going on. On my machine, I make the nethack directory and all files in it unreadable. The file /usr/games/nethack, which is the shell script that starts the game, must then be given 04755 mode, and /usr/games/lib/nethack/nethack needs only 0750 mode. 2) When a shell escape is done, or when an external pager is called to look at the help files, SIGQUIT is left ignored. This is minor, but it's incorrect. When the mailer is called for a scroll of mail, SIGHUP and SIGINT are left ignored. This, too, is incorrect. 3) When I ask nethack what an 'r' is, it says it's a rockmole. It's also a rat sometimes. The same may be true for kobolds also. 4) The code that absolutely prevents you from hitting your dog should be removed, leaving the code that asks for confirmation (and uses the HACKOPTION confirm). - Eric Backus ihnp4!{hplabs|harpo}!hp-pcd!hplsla!ericb (206) 335-2495