Re: proc question

From: Daniel Koepke (dkoepke@california.com)
Date: 01/19/97


On Sun, 19 Jan 1997, Brian Williams - Nashak wrote:

> ok.. I got a proc so that a mob shouts stuff every once in a while..
> depending on what time it is.. the only problem is.. the mob don't shout
> or nothin... here is the proc.. any idea why it's not workin? thanks

Well, first, all your 'if' statements that are returning TRUE are not
enclosed in braces.  And, in fact, shouldn't be.  Remove all the
return TRUE calls except the last one.  Much cleaner.

And second, I believe I mentioned this not too long ago, as well as
Samedi, but do_gen_comm doesn't work for mobiles, as they don't have
a desc (if (!ch->desc)).  I don't suggest removing this line.  Instead,
I would suggest setting a char pointer (char *msg) to the message
which will be "shouted" and doing:

  for (d = descriptor_list; d; d = d->next)
    if (!d->connected && d->character &&
        !PLR_FLAGGED(d->character, PLR_WRITING) &&
        !PLR_FLAGGED(d->character, PLR_MAILING))
      SEND_TO_Q(msg, d);

Easy enough, eh?


--
Daniel Koepke
dkoepke@california.com
Forgive me father, for I am sin.


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



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