Skip to content

Commit

Permalink
Strip control prefixes from debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Dec 19, 2023
1 parent a6d2f40 commit 06f07af
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Quake/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,25 @@ void Con_DebugLog(const char *msg)
}


/*
================
Con_StripControlPrefixes
================
*/
static const char *Con_StripControlPrefixes (const char *txt)
{
// colored text
if (txt[0] == 1 || txt[0] == 2)
txt++;

// [skipnotify]
if (!Q_strncmp (txt, "[skipnotify]", 12))
txt += 12;

return txt;
}


/*
================
Con_Printf
Expand All @@ -1033,7 +1052,7 @@ void Con_Printf (const char *fmt, ...)
va_end (argptr);

// also echo to debugging console
Sys_Printf ("%s", msg);
Sys_Printf ("%s", Con_StripControlPrefixes (msg));

if (!con_initialized)
return;
Expand Down

0 comments on commit 06f07af

Please sign in to comment.