🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by R Wolenty Thu, 28 Aug 1986 23:37
Spell Casting Bug in LARN 12.0
#2487
Author: R Wolenty
Date: Thu, 28 Aug 1986 23:37
40 lines
2184 bytes
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
					
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads