mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Add recursive check in Com_Printf
This prevents recursive call to Com_Printf during localization and also remove localization errors
This commit is contained in:
parent
a1e7afac76
commit
ca2322a4da
1 changed files with 10 additions and 2 deletions
|
@ -224,7 +224,12 @@ void QDECL Com_Printf( const char *fmt, ... ) {
|
|||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
static qboolean opening_qconsole = qfalse;
|
||||
static qboolean recursive_count = qfalse;
|
||||
|
||||
if (recursive_count) {
|
||||
return;
|
||||
}
|
||||
recursive_count = qtrue;
|
||||
|
||||
va_start (argptr,fmt);
|
||||
Q_vsnprintf (msg, sizeof(msg), fmt, argptr);
|
||||
|
@ -239,6 +244,7 @@ void QDECL Com_Printf( const char *fmt, ... ) {
|
|||
// TTimo nooo .. that would defeat the purpose
|
||||
//rd_flush(rd_buffer);
|
||||
//*rd_buffer = 0;
|
||||
recursive_count--;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -342,6 +348,8 @@ void QDECL Com_Printf( const char *fmt, ... ) {
|
|||
FS_Write(msg, msgLen, logfile);
|
||||
}
|
||||
}
|
||||
|
||||
recursive_count--;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue