Re: [Circle] newbie fighting question

From: Niese-Petersen (
Date: 07/28/96

On Sun, 28 Jul 1996 wrote:

This is not an answer to the question, but a warning for a common

>     for (i = world[ch->in_room].people; i; i = i->next_in_room)
  This is dangerous. Special since 'i' has a chance for dying.
If 'i' die, then 'i->next_in_room' is NULL or something weird, since
'i' is being extracted..

  what to do instead:

Add a struct char_data *next_i;

for (i = world[ch->in_room; i; i = next_i) {
  next_i = i->next_in_room;

Erik Niese-Petersen
Aka Quint The typo God
Realms of Darkness IMP [ 6666. Playertesting]

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

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