Ok, here's the info:

1) Dream_append:
--->
void dream_append(const char *str) {
   int rn;

        if (strlen(str) < 15) return;
        if (strstr(str, "tell")) return;
        if (strstr(str, "repl")) return;
        if (strstr(str, "You are")) return;
        if (index(str, ':')) return;
        if (index(str, '|')) return;
        if (index(str, '_')) return;
        if (index(str, '-')) return;

   rn = number_range(0, MAX_DREAMS-1);
   sprintf(dream_table[rn], str);
}
<---

2) List of frame 0:
--->
348     void    stop_idling             args( ( CHAR_DATA *ch ) );
349     void    bust_a_prompt           args( ( CHAR_DATA *ch ) );
350
351     /* Needs to be global because of do_copyover */
352     int port, control;
353
354     int main( int argc, char **argv )
355     {
356         struct timeval now_time;
357         bool fCopyOver = FALSE;
<---

3) bust_a_prompt:
--->
void bust_a_prompt( CHAR_DATA *ch )
{
    char buf[MAX_STRING_LENGTH];
    char buf2[MAX_STRING_LENGTH];
    const char *str;
    const char *i;
    char *point;
    char *pbuff;
    char buffer[ MAX_STRING_LENGTH*2 ];
    char doors[MAX_INPUT_LENGTH];
    EXIT_DATA *pexit;
    bool found;
    const char *dir_name[] = {"N","E","S","W","U","D"};
    int door;
 
    point = buf;
    str = ch->prompt;
    if (!str || str[0] == '\0')
    {

        sprintf( buf, "{w<{r%d{w/{R%d{r:{Rhp {c%d{w/{C%d{c:{Cm {B%d{b:{Btnl 
{w%ld {w> %s{w",
       ch->hit, ch->max_hit, ch->mana, ch->max_mana, IS_NPC(ch) ? 0 :
       (ch->level + 1) * exp_per_level(ch,ch->pcdata->points) - ch->exp,
       ch->silver, ch->prefix );
    send_to_char( buf, ch );
    return;

//      str = "{w<{R%h{w/{r%H{Rhp {B%m{w/{b%M{Bm {B%X{btnl {w%s dollars{w> {w";
    }

    
   if (IS_SET(ch->comm,COMM_AFK))
   {
    send_to_char("{R<AFK>{x ",ch);
    return;
   }

   while( *str != '\0' )
   {
      if( *str != '%' )
      {
         *point++ = *str++;
         continue;
      }
      ++str;
      switch( *str )
      {
         default :
            i = " "; break;
    case 'e':
        found = FALSE;
        doors[0] = '\0';
        for (door = 0; door < 6; door++)
        {
        if ((pexit = ch->in_room->exit[door]) != NULL
        &&  pexit ->u1.to_room != NULL
        &&   !IS_SET(pexit->exit_info, EX_JUMP)
        &&   !IS_SET(pexit->exit_info, EX_CLIMB)
        &&   !IS_SET(pexit->exit_info, EX_CRAWL)
        &&  (can_see_room(ch,pexit->u1.to_room)
        ||   (IS_AFFECTED(ch,AFF_INFRARED) 
        &&    !IS_AFFECTED(ch,AFF_BLIND))))
        {
            if ( !IS_SET(pexit->exit_info,EX_CLOSED))
            {
                found = TRUE;
                strcat(doors,dir_name[door]);
            }
            if (ch->level >= LEVEL_IMMORTAL
            && IS_SET(pexit->exit_info, EX_CLOSED))
            {
                found = TRUE;
                strcat(doors, "[");
                strcat(doors, dir_name[door]);
                strcat(doors, "]");
            }
        }
        }
        if (!found)
        strcat(buf,"none");
        sprintf(buf2,"%s",doors);
        i = buf2; break;
     case 'c' :
        sprintf(buf2,"%s","\n\r");
        i = buf2; break;
         case 'h' :
            sprintf( buf2, "%d", ch->hit );
            i = buf2; break;
         case 'H' :
            sprintf( buf2, "%d", ch->max_hit );
            i = buf2; break;
         case 'm' :
            sprintf( buf2, "%d", ch->mana );
            i = buf2; break;
         case 'M' :
            sprintf( buf2, "%d", ch->max_mana );
            i = buf2; break;
         case 'x' :
            sprintf( buf2, "%d", ch->exp );
            i = buf2; break;
     case 'X' :
        sprintf(buf2, "%d", IS_NPC(ch) ? 0 :
        (ch->level + 1) * exp_per_level(ch,ch->pcdata->points) - ch->exp);
        i = buf2; break;
     case 's' :
        sprintf( buf2, "%ld", ch->silver);
        i = buf2; break;
         case 'a' :
            if( ch->level > 9 )
               sprintf( buf2, "%d", ch->alignment );
            else
               sprintf( buf2, "%s", IS_GOOD(ch) ? "good" : IS_EVIL(ch) ?
                "evil" : "neutral" );
            i = buf2; break;
         case 'r' :
            if( ch->in_room != NULL )
               sprintf( buf2, "%s", 
        ((!IS_NPC(ch) && IS_SET(ch->act,PLR_HOLYLIGHT)) ||
         (!IS_AFFECTED(ch,AFF_BLIND) && !room_is_dark( ch->in_room )))
        ? ch->in_room->name : "darkness");
            else
               sprintf( buf2, " " );
            i = buf2; break;
         case 'R' :
            if( IS_IMMORTAL( ch ) && ch->in_room != NULL )
               sprintf( buf2, "%d", ch->in_room->vnum );
            else
               sprintf( buf2, " " );
            i = buf2; break;
            case 'z':
            if( IS_IMMORTAL( ch ) && ch->in_room != NULL )
               sprintf( buf2, "%s", ch->in_room->area->name );
            else
               sprintf( buf2, " " );
            i = buf2; break;
         case '%' :
            sprintf( buf2, "%%" );
            i = buf2; break;
         case 'o' :
            sprintf( buf2, "%s", olc_ed_name(ch) );
            i = buf2; break;
     case 'O' :
        sprintf( buf2, "%s", olc_ed_vnum(ch) );
        i = buf2; break;
         case 'L' :
        if(!IS_NPC(ch) && ch->fighting != NULL ){
           int  tmpLimit;
           int  count;
           
           sprintf(buf2, "{C[");
           if ( ch->pcdata->limit == 100 ) {
               strcat(buf2, "{W{FS U R G E!{w");
           } else {
              tmpLimit = ch->pcdata->limit;
              for(count = 0; count < 10; count++) {
               if(tmpLimit > 0) {
                  if(count == 0) 
                   strcat(buf2, "{D");
                  if(count == 3)
                   strcat(buf2, "{r");
                  if(count == 7)
                   strcat(buf2, "{R");
    
                  strcat(buf2, "+");
              tmpLimit -= 10;
               } else {
              strcat(buf2, " ");
               }
               
              } /* for */
           } /* if limit = 100  .. */
           strcat(buf2, "{C]{w");
           i = buf2; break;      
        } else {/* end isnpc */
           sprintf(buf2, " ");
           i = buf2;break; /*just to keep i equal to something if is_npc - leer 
*/
        }
      }
      ++str;
      while( (*point = *i) != '\0' )
         ++point, ++i;
   }
   *point      = '\0';
   pbuff       = buffer;
   colourconv( pbuff, buf, ch );
   write_to_buffer( ch->desc, buffer, 0 );

   if (ch->prefix[0] != '\0')
        write_to_buffer(ch->desc,ch->prefix,0);
   return;
}
<---

Thanks for your help,

Selquest of Drug Wars
dwmud.ods.org 2528
http://fly.to/dwmud

---Original Message---
I don't think it's a problem with the setting of the prompt.

Do this:

1) Copy the "dream_append" from dream.c and paste it here.
2) Send us a "print" of "frame 0" in gdb.
...and for the hell of it,
3) Send your "bust_a_prompt" from comm.c

With that, I think we can fix the problem.  I doubt it's a problem with
bust_a_prompt unless you've seriously modified it and left something
untied causing the mud to trip.

Vertigo
Realm of Lanera
------

Reply via email to