The Sendinfo BUG for EmberMUD
                      Fix Sheet 1.0 by Rindar (Ron Cole)
                       Fix 1.0 by Raven (Laurie Zenner)


NOTE:  You will need the code from NEWADD2.TXT installed for this to 
work properly.  Also, if your version of EmberMUD does not attempt to
allocate memory when using do_sendinfo (CHAR_DATA *tmp=alloc_mem
(sizeof(CHAR_DATA));), you may not need this fix.


The Bug:  Recently, the MUD I was on was experiencing a number of 
crashes when people used the AFK command.  Looking into the code, 
the following fix for AFK and a number of other information-based
bugs was discovered.  Thank Raven for the fix if you ever see her
out and about.
     

The Bugfix:  Because there are now so many version of EmberMUD out
there and ours has become so modified, I've decided not to include
the "step by step" on how to fix the bug.  Instead, just install 
the function at the bottom of this file as follows:

        1)  Open act_comm.c
        2)  Find the function "void do_sendinfo"
        3)  Delete it.
        4)  Replace it with the function at the bottom of the page. 
        5)  Recompile.  You are done.


-= Rindar
clogar@concentric.net


** Note:  This function is provided "as is" and may be used so long as 
1)  The author's name is kept at the top of the function (if requested) and
2)  all other previous licensing aggreements are abided by.  The author 
assumes no responsibility for problems that occur through use or install-
ation, including lost wages, bugs, deletions, downtimes, etc...  Use at 
your own risk.  All new code is copyrighted by its author and may be used
in all "free" MUDs.


New do_sendinfo function (act_comm.c):

void do_sendinfo( CHAR_DATA *ch, char *argument )
{
    DESCRIPTOR_DATA *d;
   char buf[MAX_STRING_LENGTH];
   
    if (argument[0] == '\0' )
    {
      if (IS_SET(ch->comm,COMM_NOINFO))
      {
        send_to_char("`BInfo channel is now ON.\n\r`w",ch);
        REMOVE_BIT(ch->comm,COMM_NOINFO);
      }
      else
      {
        send_to_char("`BInfo channel is now OFF.\n\r`w",ch);
        SET_BIT(ch->comm,COMM_NOINFO);
      }
      return;
    }
    sprintf( buf, "`WINFO: `R%s\n\r`w", argument );
    add2last( buf, NULL );
/*   strcpy(buf, "`WINFO: `R");
   strcat(buf, argument);
   strcat(buf, "\n\r`w");  
     {
        CHAR_DATA *tmp=alloc_mem(sizeof(CHAR_DATA));
        tmp->invis_level = 0; tmp->act = 0; tmp->name=str_dup(" ");
        add2last(buf,tmp);
        free_string(tmp->name);
        free_mem(tmp,sizeof(CHAR_DATA));
     }*/

    for ( d = descriptor_list; d != NULL; d = d->next )
    {
        CHAR_DATA *victim;

        victim = d->original ? d->original : d->character;
        
        if ( d->connected == CON_PLAYING &&
             !IS_SET(victim->comm, COMM_DEAF) &&
             !IS_SET(victim->comm, COMM_NOINFO) &&
             !IS_SET(victim->comm, COMM_QUIET) )
        {
            send_to_char(buf,d->character);
        }
    }

    return;
}




 =============================================================================
/   ______ _______ ____   _____   ___ __    _ ______    ____  ____   _____   /
\  |  ____|__   __|  _ \ / ____\ / _ \| \  / |  ____|  / __ \|  _ \ / ____\  \
/  | |__     | |  | |_| | |     | |_| | |\/| | |___   | |  | | |_| | |       /
/  | ___|    | |  | ___/| |   __|  _  | |  | | ____|  | |  | |  __/| |   ___ \
\  | |       | |  | |   | |___| | | | | |  | | |____  | |__| | |\ \| |___| | /
/  |_|       |_|  |_|  o \_____/|_| |_|_|  |_|______|o \____/|_| \_|\_____/  \
\                                                                            /
 ============================================================================

------------------------------------------------------------------------------
ftp://ftp.game.org/pub/mud      FTP.GAME.ORG      http://www.game.org/ftpsite/
------------------------------------------------------------------------------

 This file came from FTP.GAME.ORG, the ultimate source for MUD resources.

------------------------------------------------------------------------------