Re: Room Question

From: Matt Knecht (hex@VOICENET.COM)
Date: 03/30/98


On Mon, 30 Mar 1998, Paul Siegel wrote:
>I'm tryingt to write a spell that will heal/hurt everyone in the same room
>as the caster (excluding the caster).  I'm not sure exactly where in the
>code to look for info on who's in a given room, and was wondering if
>anyone could give me a little push in the right direction.  Thanks.

grep "void act" *.c

That should take you to comm.c.  act() sends things to people in a room.

What you basically want is something like:

struct char_data *tch;

for (tch = world[ch->in_room].people; tch; tch = tch->next_in_room) {
  if (tch == ch)
    continue;
  do_something_with_tch_here;
}


This was just written on the fly... excuse any bugs :)

--
Hextall, an Implementor of Exile  *    888`98  9b.dP  888  888     888`98
exile.linex.com 4000              *    888+8,   d8b   888  888  ,  888+8,
The mud you've been looking for   *    888,d8  d8 9b  888  888,d8  888,d8


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