From: dennis@starlifter.reichel.net

Hi,

This is from my Rom 2.4b4, but might apply to many other
merc derivatives.   (heh - probably dates to whatever code
first implemented the ROOM_SAFE flag :)

I believe it is a good idea to move the test for room is
safe from the second for loop to the first one.
After all, the whole point of the first loop is to 
find a room with a player who might be aggressed on
in it.  

orig code for context:

    for ( wch = char_list; wch != NULL; wch = wch_next )
    {
	wch_next = wch->next;
	if ( IS_NPC(wch)
	||   wch->level >= LEVEL_IMMORTAL
	||   wch->in_room == NULL 
	||   wch->in_room->area->empty)
	    continue;

	for ( ch = wch->in_room->people; ch != NULL; ch = ch_next )
	{
	    int count;

	    ch_next	= ch->next_in_room;

	    if ( !IS_NPC(ch)
	    ||   !IS_SET(ch->act, ACT_AGGRESSIVE)
remove:	    ||   IS_SET(ch->in_room->room_flags,ROOM_SAFE)
	    ||   IS_AFFECTED(ch,AFF_CALM)

New placement shown:

    for ( wch = char_list; wch != NULL; wch = wch_next )
    {
	wch_next = wch->next;
	if ( IS_NPC(wch)
	
	||   wch->level >= LEVEL_IMMORTAL
	||   wch->in_room == NULL
	||   wch->in_room->area->empty
	/* is better place to determine this */
insert:	||   IS_SET(wch->in_room->room_flags,ROOM_SAFE) )
	    continue;
	    
Remember if cut/paste - wch is not ch :)

TTYL, Dennis