mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 22:51:57 +00:00
fix infinite loop with server color parsing
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2165 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
6b8fac1fa4
commit
f482d8a514
2 changed files with 9 additions and 5 deletions
|
@ -215,8 +215,8 @@ void ApplyColour(unsigned int chr)
|
|||
if (chr & CON_BLINKTEXT)
|
||||
printf("5;"); // set blink
|
||||
|
||||
bg = chr & CON_BGMASK >> CON_BGSHIFT;
|
||||
fg = chr & CON_FGMASK >> CON_FGSHIFT;
|
||||
bg = (chr & CON_BGMASK) >> CON_BGSHIFT;
|
||||
fg = (chr & CON_FGMASK) >> CON_FGSHIFT;
|
||||
|
||||
// don't handle intensive bit for background
|
||||
// as terminals differ too much in displaying \e[1;7;3?m
|
||||
|
@ -254,7 +254,7 @@ void ApplyColour(unsigned int chr)
|
|||
fg &= 0x7; // strip intensive bit
|
||||
}
|
||||
|
||||
printf("3%im", fg); // set foreground
|
||||
printf("3%im", ansiremap[fg]); // set foreground
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -371,7 +371,9 @@ void Sys_Printf (char *fmt, ...)
|
|||
ext = ((*str - '0') << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
|
||||
continue;
|
||||
}
|
||||
str--; // else invalid code
|
||||
Sys_PrintColouredChar('^' | ext);
|
||||
Sys_PrintColouredChar('&' | ext);
|
||||
// else invalid code
|
||||
}
|
||||
else if (*str == 'a')
|
||||
{
|
||||
|
|
|
@ -581,7 +581,9 @@ void Sys_Printf (char *fmt, ...)
|
|||
ext = ((*str - '0') << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
|
||||
continue;
|
||||
}
|
||||
str--; // else invalid code
|
||||
Sys_PrintColouredChar('^' | ext);
|
||||
Sys_PrintColouredChar('&' | ext);
|
||||
// else invalid code
|
||||
}
|
||||
else if (*str == 'a')
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue