Re: [CODE] [NEWBIE] Guild system

From: ;P (siv@CYBERENET.NET)
Date: 11/24/97


>   if(IS_NPC(ch))
>     return 0;
>   else if(!CMD_IS("gain") && !CMD_IS("practice"))
>     return 0;
>   else
>     continue;

you don't need the else continue thing there..

> i = 0;
> while(guilds[i].class != -1) {
>    if (GET_CLASS(ch) == guilds[i].class && world[ch->in_room].number ==
> guilds[i].room)
>      found = TRUE;
>    else
>      found = FALSE;
>    }

you aren't incrementing i...and you should probably just use a for
loop..easier to read IMHO..

> if (!found) {
>    send_to_char("You can't do that here.\r\n", ch);
>    return 0;
>    }
> else if (found)
>    continue;

the everything after the "}" is redundant..

yep...other than that, it looks good..the not incrementing the i is the
error..the other stuff is just style i guess..

siv


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