Path: utzoo!mnetor!uunet!mcvax!ukc!stc!datlog!dlhpedg!cl From: cl@dlhpedg.co.uk (Charles Lambert) Newsgroups: comp.sources.d Subject: NetHack 2.2: objects[] bug Message-ID: <337@dlhpedg.co.uk> Date: 15 Dec 87 16:45:01 GMT Sender: news@dlhpedg.co.uk Reply-To: cl@datlog.co.uk (Charles Lambert) Organization: FSG@Data Logic Ltd, Queens House, Greenhill Way, Harrow, London. Lines: 23 I have built NetHack 2.2 for HP-UX (Hewlett Packard UNIX-like). To keep the game simple, I didn't switch on all the optional stuff: specifically, I left SAC undefined so there are no soldiers. When I tried to run the game, it printed the message init-prob error for * (80%) To cut a long story short: leaving soldiers out means that there are fewer objects (to wit, no dead soldier) in objects[] (see objects.h). As a result, the defined constant indeces for objects[] were wrong; the code that sets initial probabilities for valuable gems was overwriting the probabilities for "worthless piece[s] of coloured glass"; and the sum of probabilities for all gems was coming out wrong. I still haven't worked out the most elegant fix. I think the whole design of the objects database and access to it ought to be rehashed, to allow for dynamic sizing, but that's a big job. As a quick-fix, I'll probably replace the defined indeces with variables calculated early in the initialisation. -------------------- Charlie