From 7e3b3d3df7d3ade3c9e845425a1282d6c666acaf Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 18 Sep 2006 22:47:06 +0000 Subject: [PATCH] Fixed colour codes in centerprints. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2385 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_screen.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/client/cl_screen.c b/engine/client/cl_screen.c index 78e753b85..0a4cc9c1a 100644 --- a/engine/client/cl_screen.c +++ b/engine/client/cl_screen.c @@ -199,6 +199,7 @@ void CopyAndMarkup(conchar_t *dest, qbyte *src, int maxlength) if (*src >= '0' && *src <= '9') { ext = q3codemasks[*src - '0'] | (ext&~CON_Q3MASK); + src++; continue; } else if (*src == '&') // extended code @@ -460,6 +461,7 @@ void SCR_DrawCenterString (int pnum) int x, y; int remaining; int hd = 1; + int screenwidth; vrect_t rect; @@ -486,6 +488,8 @@ void SCR_DrawCenterString (int pnum) y += rect.y; + screenwidth = 40;//vid.width/8; + if ((start[0]&255) == '/') { if ((start[1]&255) == 'O') @@ -506,10 +510,10 @@ void SCR_DrawCenterString (int pnum) do { // scan the width of the line - for (l=0 ; l<40 ; l++) + for (l=0 ; l<=screenwidth ; l++) if ((start[l]&255) == '\n' || !(start[l]&255)) break; - if (l == 40) + if (l == screenwidth+1) { while(l > 0 && (start[l-1]&255)>' ' && (start[l-1]&255) != ' '+128) {