sippy@f.gp.cs.cmu.edu (Jay Sipelstein) (08/22/89)
In article <849@occrsh.ATT.COM> rjd@occrsh.UUCP (Randy_Davis) writes: > > We have noticed an intermittant bug that is real handy around here. >Sometimes, while fighting and killing a rust monster, you will be awarded >an armor class of 257 (in the range of 252 to 257 or so) upon the death of >the rust monster. I have checked for proper declaration of variables of >all those variables concerned with or added/subtracted to the armor class >(integer at least, as long as not char) and everything seems OK. I posted a bug fix for this a few monthes ago. The array rustarm is declared to be char. This is fine, unless you're on a machine with unsigned chars (like the IBM RT, and probably yours). The fix is to change the declaration to static short int rustarm[ARMORTYPES][2] in monster.c As long as I'm posting, there are some other bugs that I've fixed. In tok.c, the function sethard() has some problems. For one thing, if your playing at hardness greater than 0, the god of hellfire will have no hitpoints. Change the line setting monster hitpoints to the following: monster[j].hitpoints = (i > 32767) ? 32767 : i; this will fix an overflow bug. In scores.c the declaration for the scofmt structure needs to be changed on machines with unsigned chars. The sciv field must be declared as short, rather than char. This will fix a problem with ularn -i giving incorrect pluses for items. In monster.c, the protection given by SLAYER against demon damage is incorrectly calculated. Line 1402 should be changed to: dam=(int) ((1 - 0.1 * rnd(5)) * dam); Also in monster.c, there is a mistake in hitmonster() that results in a player's random stat being used to calculate to hit probabilities instead of their weapon class. Change line 1230 to: tmp = monster[monst].armorclass + c[LEVEL] + c[DEXTERITY] + c[WCLASS]/4 -12 - c[HARDGAME]; The original line used c[WCLASS/4]! There's also a bug involving the code to parse the number of gold pieces you want to drop. This can be used to get lots of gold if you drop too much. I fixed this by not allowing more than MAXINT/10 (+- fudge factor to do parsing) goldpieces. Something official should be done about this. Jay Sipelstein sippy@cs.cmu.edu