Author Topic: /secure/daemon/chat.c bugfix  (Read 1380 times)

Offline z993126

  • BFF
  • ***
  • Posts: 128
    • View Profile
/secure/daemon/chat.c bugfix
« on: March 17, 2012, 11:12:27 PM »
It inadvertently came to my attention that mischief is able to be had on the intermud channels when using shadow objects, which cloak a person's real name.

In /secure/daemon/chat.c, in the function cmdChannel(), changing the lines

Code: [Select]
    //If admin or cre channels, Capitalize a person's real name, because admins can be physically hidden
    if( verb == "admin" || verb == "cre" ) {
        if( !(name = this_player()->GetCapName()) )
            name = capitalize(this_player()->GetKeyName());
    }
    else name = this_player()->GetName();

in the original to

Code: [Select]
//If admin or cre channels, Capitalize a person's real name, because admins can be physically hidden
// also check for intermud channels; don't hide on those!
switch( verb ){
case "admin":     case "cre":          case "dchat":  case "ds":  case "ds_test":  case "free_speech":
case "admin:":    case "cre:":         case "dchat:": case "ds:": case "ds_test:": case "free_speech:":
case "intercre":  case "intergossip":  case "lpuni":
case "intercre:": case "intergossip:": case "lpuni:":
if( !undefinedp( this_player()->GetShadowedName() ) ){
if( !( name = this_player()->GetShadowedName() ) || this_player()->GetShadowedName() == "A shadow" ){
name = capitalize( cleaned_end( base_name( this_player() ) ) );
}
}else if( !( name = this_player()->GetCapName() ) ){
name = capitalize( this_player()->GetKeyName() );
}
break;
default:
name = this_player()->GetName();
break;
}

forces a user when invis and/or shadowed to display their 'real' character name on intermud, cre, and admin channels.