Related to:http://dplogin.com/forums/index.php?topic=11180.0Bug:When you use underline and/or italics in your name and do not:
(1) terminate the underline/italics; or
(2) use a char_endformat (ctrl+o) at the end of your name
it frequently messes up the formatting on the line of text appearing after your name (e.g., chat, scoreboard, event text).
Note:Only the lines that have
// herron format fix on them were changed, and the precise change is (listed in parentheses). This does not fix the scoreboard that pops up at the end of the map, but it does fix the one that is brought up manually.
Fix:1. In cl_decode.h: case 'n': // name
Q_strncpyz(out_str, name_from_index(index_array[current_element++]), max_len);
temp_len = strlen(out_str);
out_str[temp_len] = CHAR_ENDFORMAT; // herron format fix (new)
out_str += temp_len+1; // herron format fix (temp_len"+1")
max_len -= temp_len+1; // herron format fix (temp_len"+1")
break;
What it does: Prevents underlined/italics in names from carrying over into event print messages (e.g., joins, grabs, kills, etc.)2. In cl_scores.c:Part A if (len_noformat >= MAX_NAME_WIDTH) // name too long // herron format fix (">"=)
Part B else if (format_diff)
{
// add spaces to compensate for format codes
memset(cl_scores_info[i]+len, ' ', MAX_NAME_WIDTH - len_noformat);
cl_scores_info[i][len] = CHAR_ENDFORMAT; // herron format fix (new)
cl_scores_info[i][MAX_NAME_WIDTH+format_diff+1] = '\0'; // herron format fix (format_diff"+1")
}
What it does: Prevents underlined/italics in names from carrying over into other columns on the scoreboard (e.g., ping, kills, deaths, etc.)3. In cl_parse.c: if (cl_timestamp->value)
Com_Printf("%c%c[%s] %c%s%s%s%c%c%c%s%s %s%s", // herron format fix (%s%s%s"%c")
CHAR_COLOR, isteam ? cl_scores_get_team_textcolor(idx) : COLOR_CHAT,
timestamp, cl_scores_get_team_splat(idx),
cl_scores_get_isalive(idx) ? "" : "[ELIM] ",
(isteam || isprivate) ? "(" : "", name_from_index(idx), CHAR_ENDFORMAT, // herron format fix ("CHAR_ENDFORMAT,")
CHAR_COLOR, isteam ? cl_scores_get_team_textcolor(idx) : COLOR_CHAT,
(isteam || isprivate) ? ")" : "",
level == PRINT_CHATN_ACTION ? "" : ":",
s, (s[strlen(s)-1] == '\n') ? "" : "\n");
else
Com_Printf("%c%c%c%s%s%s%c%c%c%s%s %s%s", cl_scores_get_team_splat(idx),
CHAR_COLOR, isteam ? cl_scores_get_team_textcolor(idx) : COLOR_CHAT,
cl_scores_get_isalive(idx) ? "" : "[ELIM] ", // jitodo - [OBS]
(isteam || isprivate) ? "(" : "", name_from_index(idx), CHAR_ENDFORMAT, // herron format fix ("CHAR_ENDFORMAT,")
CHAR_COLOR, isteam ? cl_scores_get_team_textcolor(idx) : COLOR_CHAT,
(isteam || isprivate) ? ")" : "",
level == PRINT_CHATN_ACTION ? "" : ":",
s, (s[strlen(s)-1] == '\n') ? "" : "\n");
What it does: Prevents underlined/italics in names from carrying over into chat messages (e.g., say and say_team)