Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!husc6!hao!gaia!jon From: jon@gaia.UUCP (Jonathan Corbet) Newsgroups: comp.sources.bugs Subject: A couple of nethack bug fixes Message-ID: <339@gaia.UUCP> Date: 19 Dec 87 06:18:45 GMT Organization: Gaia Corp, Boulder, CO Lines: 32 I found the answer to the bug I posted the other day, wherein the dungeon was simply devoid of objects on Microport systems. I'm not sure of the bug is in the nethack code, or in the Microport C compiler. What happens is that the result of the somex() and somey() macros in mklev.c are "xchar" values, while the mkgold() and mkobj_at() routines expect full integers. Most compilers will widen the values accordingly, but not here...The fix is to go into mklev.c, and change lines like mkgold (0L, somex (), somey ()); to mkgold (0L, (int) somex (), (int) somey); and similarly with the mkobj_at() calls. I think there were only three that needed to be changed. I also found the nifty glitch that can cause failures if you set "dogname" in HACKOPTIONS. Line 406 of options.c reads: if(*cs == ',') break; which is fine unless "dogname" is the last option you set, in which case there is no comma. Replace with: if(*cs == ',' || *cs == '\0') break; and the problem goes away. -- Jonathan Corbet {rutgers | ames | gatech}!hao!gaia!jon {uunet | ucbvax | allegra | cbosgd}!nbires!gaia!jon