One of the things SMAUG has
done, is most structs are in a doubly linked list. So you can traverse lists with ease. For example if you wanted to send to every character (mobs
included) some text, you would have a loop like this:
for(rch = first_char; rch; rch =
rch->next)
ch_printf(ch, “%s\n\r”, txt_pointer);
You could also traverse
through all the areas in the game:
for(area = first_area; area; area =
area->next);
The same holds true of just
about anything that comes in stock SMAUG.
Now if you want to display a message to all the characters, you could
use the code above and add if(IS_NPC(rch)) continue; but a more practical,
faster, way of doing that, is going through the descriptors.
DESCRIPTOR_DATA *d;
for(d=first_descriptor; d; d=
d->next) {
if(!CH(d)) continue;
send_to_ch_printf(CH(d), “%s\n\r”. argument) ;
}
The CH is just a define that points to d->character or d->original.