Re: [code] quick question. <Pine.SOL.3.92.971107124727.6361C-100000@redwings>

From: Jeremy Elson (jelson@CIRCLEMUD.ORG)
Date: 11/07/97


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.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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