Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!cornell!svax!gil From: gil@svax.cs.cornell.edu (Gil Neiger) Newsgroups: comp.sources.bugs,rec.games.hack Subject: Fix to (net)hack makemon bug Message-ID: <1725@svax.cs.cornell.edu> Date: Fri, 16-Oct-87 13:10:44 EDT Article-I.D.: svax.1725 Posted: Fri Oct 16 13:10:44 1987 Date-Received: Sat, 17-Oct-87 21:57:25 EDT Reply-To: gil@svax.cs.cornell.edu (Gil Neiger) Organization: Cornell Univ. CS Dept, Ithaca NY Lines: 74 Xref: mnetor comp.sources.bugs:368 rec.games.hack:1620 Here is the beginning of my hack.makemon.c; modifying nethack's makemon.c in a similar way should fix the standard "makemon" panic. However, this will not generate bats if KOPS is turned on. To fix this, in the file monst.c the monster "Keystone Kop" (bracketed by "#ifdef KOPS" and "#endif KOPS") should be make the FIRST monster in the array permonst; the monster "Kobold" (bracketed by "#ifndef KOPS" and "#endif KOPS") should be left where it is. - Gil ==================================== /* $Header: hack.makemon.c,v 2.3 87/05/29 10:18:36 gil Exp $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.makemon.c - version 1.0.2 */ #include "hack.h" extern char fut_geno[]; extern char *index(); extern struct obj *mkobj_at(); struct monst zeromonst; /* * called with [x,y] = coordinates; * [0,0] means anyplace * [u.ux,u.uy] means: call mnexto (if !in_mklev) * * In case we make an Orc or killer bee, we make an entire horde (swarm); * note that in this case we return only one of them (the one at [x,y]). */ struct monst * makemon(ptr,x,y) register struct permonst *ptr; { register struct monst *mtmp; register tmp, ct; boolean anything = (!ptr); #ifdef KOPS int kopsoffset = 1; #else KOPS int kopsoffset = 0; #endif KOPS if(x != 0 || y != 0) if(m_at(x,y)) return((struct monst *) 0); if(ptr){ if(index(fut_geno, ptr->mlet)) return((struct monst *) 0); } else { ct = CMNUM - strlen(fut_geno); if(index(fut_geno, 'm')) ct++; /* make only 1 minotaur */ if(index(fut_geno, '@')) ct++; if(ct <= 0) return(0); /* no more monsters! */ tmp = 7; /* changed 3/31/87 as per mods */ tmp -= kopsoffset; #ifdef ROCKMOLE if(dlevel<4)tmp--; #endif ROCKMOLE tmp = rn2(ct*dlevel/24 + tmp); if(tmp < dlevel - 4) tmp = rn2(ct*dlevel/24 + 12); if(tmp >= ct - kopsoffset) tmp = rn1(ct - ct/2, ct/2 - kopsoffset); ct = kopsoffset; for(; ct < CMNUM; ct++){ ptr = &mons[ct]; if(index(fut_geno, ptr->mlet)) continue; if(!tmp--) goto gotmon; } impossible("Couldn't make a monster"); return((struct monst *) 0); } gotmon: ...