Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, DotBot

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
481
3,740
19,396
629
DarrenPayn
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Odd return from emote modific...
Forum Rules | Mark all | Recent Posts

Odd return from emote modification
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 12, 2010, 9:44 am
Go to the top of the page
Go to the bottom of the page

Keirath
Magician
GroupMembers
Posts144
JoinedJan 24, 2008

Well, I've recently modified emote to allow for a target. Now, I've got it mostly working like this:
  for ( rch = ch->in_room->first_person; rch; rch = rch->next_in_room )
  {
       while (isspace(*chlast))
          chlast++;
        chlast = buf3;

        while( *chlast )
        {
          if( *chlast == '@' )
          {
             chlast++;
             while(*chlast >= '0' && *chlast <= '9' )
             {
              	chtar[char_num++] = *(chlast++);
             }

             if(*chlast == '.' )
             {
              	chtar[char_num++] = *(chlast++);
             }
             while(isalpha(*chlast) || *chlast=='-')
             {
              	chtar[char_num++] = *(chlast++);
             }
             chtar[char_num] = '\0';
             char_num = 0;
             if ( (cch = get_char_room(ch, chtar)) == NULL)
             {
              	sprintf(chtarget,"I don't see %s here!\r\n",chtar);
                send_to_char(chtarget,ch);
                return;
             }
             else if( cch == ch )
             {
              	send_to_char( "Use $n to refer to yourself.\r\n", ch);
                return;
             }
             if( cch != rch )
               sprintf(persch, "%s", PERS(cch, rch));
             else
               sprintf( persch, "%s", "you" );

               sprintf( chtar3, "@%s", chtar );
               sprintf(buf3,"%s",strrep(buf3, chtar3, persch ));         
           }
          chlast++;            
        }
           if ( rch != ch )
               act(AT_SOCIAL, buf3, ch, NULL, rch, TO_VICT );
            else
               act(AT_SOCIAL, buf3, ch, NULL, NULL, TO_CHAR );
}


Now for the most part this works great. But occasionally, depending on how I order an emote's @s while using multiple targets, it returns the @string in the form it was entered. I'm not sure why this is happening. Anybody see what may be going wrong here?

Example:

emote grins at @kyran and at @keirath and @tylas
I see:
Ravaus grins at Kyran and at Keirath and at Tylas.
Keirath sees:
Ravaus grins at A covered being and at you and @tylas.
And the others see it correctly.

       
Pages:<< prev 1 next >>