Re: [CODE] ARg these damn uilds be killin me!

From: Jonathan Barrett (mixtli@SINFO.NET)
Date: 11/25/97


> for(i=0;guilds[i].class != -1;i++)
>     if (GET_CLASS(ch) == guilds[i].class && world[ch->in_room].number ==
>     guilds[i].guild_room) {
>          found = TRUE;
>          continue;
>      }else
>         i++;
>
You don't need to increment i in a for loop, that's what the i in the
statement does.  Continue is useless if you already have a match.  And try
putting () around your coditions to make them more understandable.
Example:

for(i=0; guilds[i].class !=-1;i++)
    if ( (GET_CLASS(ch)  == guilds[i].class) && (world[ch->in_room].number
== guilds[i].guild_room) ) {
       found = TRUE;
       break;
    }


     +------------------------------------------------------------+
     | 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