Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!clyde!cbatt!cbosgd!ihnp4!inuxc!inuxj!wolenty From: wolenty@inuxj.UUCP (R Wolenty) Newsgroups: net.games,net.sources.bugs Subject: Spell Casting Bug in LARN 12.0 Message-ID: <247@inuxj.UUCP> Date: Thu, 28-Aug-86 19:37:55 EDT Article-I.D.: inuxj.247 Posted: Thu Aug 28 19:37:55 1986 Date-Received: Sun, 31-Aug-86 05:03:05 EDT Distribution: net Organization: AT&T Consumer Products, Indianapolis Lines: 40 Xref: mnetor net.games:1580 net.sources.bugs:791 I ran into a bug that has been mentioned before: when casting lightening I experienced total lockup. Needless to say, I was having my best game ever when this unfortunate event occurred. After some experimentation in wizard mode I noticed that this only occurred when casting lightening not balls of fire, cones of cold or the like. The difference was in the call to display the spell: lightening(being the fast stuff it is) only had a delay of 1 ms as opposed to the 20 to 30 ms in other spells. Looking into 'nap.c' there is a routine to generate millisecond delays. This routine gets a time value and assigns it to the variable matchclock: matchclock = times(some_arg). Then matchclock is incremented by the amount of time you want to delay: matchclock += (time/x) Where x = 17 for DEC systems and 10 for AT&T systems. Then the crucial loop is then: while(matchclock < times(some_arg)); Note that this loop condition is immediately false because we just added some time interval to matchclock so the function returns. The problem is when this routine is called with a delay of 1 ms 1/x is 0 as far as integers are concerned so no time gets added to matchclock. Now if you are so unfortunate as to have the system clock increment between matchclock = times() and the while statement, matchclock will be less than the system time for one very long while! So in short go into nap.c and make the while statement read: while(matchclock > times(some_arg)); Sorry to be so long with this but after losing that wonderful game I needed the therapy! Ron Wolenty AT&T Information Systems Indianapolis, IN