Re: A few questions on clans

From: Mehdi Keddache (
Date: 01/26/97

On Sun, 26 Jan 1997, Nicholas S. Wourms wrote:

> I have seen many responses to clans, and I have a few questions myself.
> 1)Which, of all the ones that popped up, is the correct fix for is_playing
> struct?
There is no "fix" for the function itself i believe since no one talked
about having to modify it. People reported having problems writing
prototypes for it as far as I have seen. To make sure this is the body of
the function
struct char_data *is_playing(char *vict_name)
  extern struct descriptor_data *descriptor_list;
  struct descriptor_data *i, *next_i;

  for (i = descriptor_list; i; i = next_i) {
    next_i = i->next;
    if(i->connected == CON_PLAYING && !strcmp(i->character->,CAP(vict_name)))
      return i->character;
  return NULL;

> 2)Where is the best place to put the structre?
I like to put it in utils.c because I use it a lot but if you only use it 
in the clan code the best thing to do is to put it in clan.c before any
other function that calls it.

> 3)I did a proto declaration
as(In the beginning of clan.c): > extern struct char_data *is_playing;
> Is this right?
You don't need to put extern in a function prototype, but you need to
specify the type of the arguments:
struct char_data *is_playing(struct char_data * ch);
is how I have it

> 4)I get the following error:
> clan.c:1100: warning: assignment from incompatible pointer type
>   From the following line of code:
> ch->desc->str   = clan[clan_num].description;
> What's wrong here?
As I said when I sent the code, the clan description doesn't work. so just
comment out or remove the command part, the compilation is just warning
you so you can also leave it be, it won't crash, but the dscription you
enter will just not take effect.

Mehdi Keddache (Heritsun on Eclipse of Fate 7777)

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

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