diff --git a/engine/common/console.h b/engine/common/console.h index c0cea3a5f..5670620da 100644 --- a/engine/common/console.h +++ b/engine/common/console.h @@ -85,7 +85,7 @@ extern conchar_t q3codemasks[MAXQ3COLOURS]; #define CON_TEXTSIZE 16384 -#define isextendedcode(x) ((x >= '0' && x <= '9') || (x >= 'A' && x <= 'F') || x == '-') +#define isextendedcode(x) (((x) >= '0' && (x) <= '9') || ((x) >= 'A' && (x) <= 'F') || (x) == '-') typedef struct console_s { diff --git a/engine/server/sv_sys_unix.c b/engine/server/sv_sys_unix.c index 4317f8604..6213efebf 100644 --- a/engine/server/sv_sys_unix.c +++ b/engine/server/sv_sys_unix.c @@ -265,12 +265,14 @@ void Sys_PrintColouredChar(unsigned int chr) { ApplyColour(chr); + chr = chr & CON_CHARMASK; + if ((chr > 128 || chr < 32) && chr != 10 && chr != 13 && chr != 9) printf("[%02x]", chr); else chr &= ~0x80; - putch(chr & CON_CHARMASK); + putch(chr); } /* @@ -372,7 +374,6 @@ void Sys_Printf (char *fmt, ...) continue; } Sys_PrintColouredChar('^' | ext); - Sys_PrintColouredChar('&' | ext); // else invalid code } else if (*str == 'a') diff --git a/engine/server/sv_sys_win.c b/engine/server/sv_sys_win.c index a7ad57158..6917b39ba 100644 --- a/engine/server/sv_sys_win.c +++ b/engine/server/sv_sys_win.c @@ -582,7 +582,6 @@ void Sys_Printf (char *fmt, ...) continue; } Sys_PrintColouredChar('^' | ext); - Sys_PrintColouredChar('&' | ext); // else invalid code } else if (*str == 'a')