Guild Code

From: ;P (siv@CYBERENET.NET)
Date: 04/21/98


> I talked about my guild code, and it's practically done.  Well,
> technically it is, but I'd
> like to clean it up in one area.  I'm using room flags in guilds to
> determine which class it
> is that is being joined.  Can I determine which guild they are in
> another way?  Like
> guild_info[something].yadda

int is_in_guild(struct char_data *ch)
{
  struct guild_info {
    byte class;
    sh_int guild_vnum;
  } guilds[] =
  {
    { CLASS_CLERIC, 3004 },
    { CLASS_RANGER, 4509 },
    { CLASS_BUTT_PIRATE, 5698 },
    { -1, -1 }
  };
  int i;

  for (i = 0; guilds[i].class == -1; i++)
    if (GET_CLASS(ch) == guilds[i].class &&
        IN_ROOM(ch) == real_room(guilds[i].guild_vnum))
      return TRUE;

  return FALSE;
}

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/15/00 PST