Re: new attempt at teleport rooms

From: Stefan Joe Yen (psycho@ren.psy.jhu.edu)
Date: 09/01/95


On Fri, 1 Sep 1995, Graham Gilmore wrote:

> > void do_teleports(void)
> > {
> >   struct char_data *vict, *next_v;
> >   int i;
> >   for (i = 1; i < NUM_TELEPORT_ROOMS; i++)  
> 	Two things.  Your exit condition and your i increment are 
> reversed (causing i to increase without bound).  Also, the first element 
> of the array is 0, not 1.  Try this.
> 
>     for (i = 0; i++; i < NUM_TELEPORT_ROOMS)
> 
> 
Unless C Syntax has suddenly gone bonkers while I slept last night, the 
exit condition of a for loop does come first, then the increment. Array 
indicies do start at 0 though so the line should be:

       for (i = 0; i < NUM_TELEPORT_ROOMS; i++) 

I'm not sure that thats the complete cause of the problem, but it 
certainly couldn't hurt to start at the correct spot in the array.
I'll have more to say when I get a chance to look at the code more 
carefully. Hope this helps though.


						- Stefan



This archive was generated by hypermail 2b30 : 12/07/00 PST