Re: do_say

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 09/05/00


Can't possibly see why you're messing with do_say, but here goes
anyways...

Matthew Kuebbeler wrote:

> ACMD(do_say)
> {
>   skip_spaces(&argument);
>
>   if (!*argument)
>     send_to_char("Yes, but WHAT do you want to say?\r\n", ch);
>   else {
>     delete_doubledollar(argument);

Note the following comment from interpreter.c...

/*
 * Given a string, change all instances of double dollar signs ($$) to
 * single dollar signs ($).  When strings come in, all $'s are changed
 * to $$'s to avoid having users be able to crash the system if the
 * inputted string is eventually sent to act().  If you are using user
 * input to produce screen output AND YOU ARE SURE IT WILL NOT BE SENT
 * THROUGH THE act() FUNCTION (i.e., do_gecho, do_title, but NOT
do_say),
 * you can call delete_doubledollar() to make the output look correct.
 *
 * Modifies the string in-place.
 */
char *delete_doubledollar(char *string)

In other words DO NOT USE delete_doubledollar() ON A STRING WHICH WILL
BE PASSED TO act()!

>     sprintf(buf, "You say, '%s'\r\n", argument);
>     act(buf, FALSE, ch, 0, 0, TO_ROOM);

Here you're sending "You say..." to the rest of the room, shouldn't this
be "$n says..."?
>
>     if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
>       send_to_char(OK, ch);
>     else {

Why are you using "you tell the group" here?  Isn't this do_say, or did
I miss something?  At any rate, I would recommend using act if you
haven't run it through delete_doubledollar, otherwise run it through
delete_doubledollar and use send_to_char.

>       sprintf(buf, "You tell the group, '%s'\r\n", argument);
>       send_to_char(buf, ch);
>     }
>   }
> }

Regards, Peter


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT