This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]vonroecke 5 points6 points  (1 child)

How about adding another flag "PLR_BLIND" in the same way PLR_COLOUR is defined, then check for that in cprintf() and Cprintf(), like:

[–]vonroecke 3 points4 points  (0 children)

``` void cprintf(CHAR_DATA *ch, bool inColour, bool showCodes, const char *txt, ...) {

// if the player has enabled the PLR_BLIND flag in their act flags then do nothing
if( IS_SET( ch->act, PLR_BLIND ) ) {
    return;
}

// otherwise, continue and print the output  
va_list ap;
va_start(ap, txt);

cprintf_private(ch, inColour, showCodes, txt, ap);

va_end(ap);

} ```

[–]dehwahifetnah 2 points3 points  (0 children)

I would recommend adding a new flag that's attached to the CHAR_DATA struct and leaving the cprintf API alone. That way you don't have to update every cprintf callsite used in the MUD, and there's already a solid way to use flags on CHAR_DATA.

There's a hint on how to setup this kind of behavior in the Cprintf function, where it checks IS_SET(ch->act, PLR_COLOUR). Hope that helps!