Re: [code] quick question.

From: Desmond Daignault (tekdd@DTOL.DATATIMES.COM)
Date: 11/07/97

On Fri, 7 Nov 1997, Jeremy Elson wrote:

=>Desmond Daignault writes:
=>>I have a function that scrolls through all of the mobs/players in a room
=>>that keeps breaking when doing a tch->next_in_room;
=>>the for statement used is:
=>>for(tch = world[ch->in_room].people;tch; tch = next_tch)
=>>and it dies doing:
=>>  next_tch = tch->next_in_room;
=>Make sure that next_tch is the *first* statement in the body of the
=>for loop.  If you make it the last statement, there's no point in
=>using the next_tch temporary variable.

it was a stupid bug. (yes the next_tch thingy was first in the loop) what
it was is i had declared a string to hold the name of each person in the
room to see where it was dieing and that string wasn't big enough for some
of the mobile names.

*bonk self on head*



void signature () {
  printf ("Praise not the day until evening has come; a woman\n"
          "until she is burnt; a sword until it is tried; a maiden until\n"
          "she is married; ice until it has been  crossed; beer until it\n"
          "has been drunk.   -- Viking Proverb\n");

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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