Wrong position of colour embedding -
leong124 - 08.10.2011
Hi, today I find that if "Full sized space" in Big5 coding(where its value is 0xA140, which is the first Big5 character) is used in colour embedding, the whole text will be coloured wrongly, similar to the bug found in 0.3c RC1.
Code in OnPlayerText:
pawn Code:
ReColorText(chat);
format(string,sizeof(string),"%s(%d): {FFFFFF}%s",nname[playerid],playerid,chat);//nname[playerid] is the nick name of the player
SendClientMessageToAll(GetPlayerColor(playerid),string);
When I use 3 of that character in my nick name with 3 normal dots (".") (see attachment 1) and 4 type an uncoloured text:
The first 3 text characters are wrongly coloured (see attachment 1). The number of wrongly coloured text is equal to the number of that space character in the text.
Other characters works fine as you can see in attachment 2(which the "full sized comma" has a value of 0xA141)
This shouldn't be a problem of my script, because you can find "{FFFFFF}" before the message in the format code, so it must be in white if the message is uncoloured.
I think this is not difficult to fix, so I hope there'll be a fix soon.
Edit:
A simple code to reproduce the problem:
pawn Code:
SendClientMessageToAll(0xFFFF00FF,"test : {FFFFFF}A quick brown fox jumps over the lazy dog.");
//There're 2 full-sized spaces between the word "test" and the colon ":".
Re: Wrong position of colour embedding -
Karlip - 08.10.2011
Try the 0.3d section and there might be a chance it's fixed during RC's, if lots of people confirm it.
What is the full function of ReColorText?
Re: Wrong position of colour embedding -
leong124 - 09.10.2011
The ReColorText function is quite similar to Y_less'. The bug should have nothing to do with that.
Re: Wrong position of colour embedding -
leong124 - 20.10.2011
Bump, and I added a simple code to reproduce the bug.
Please check it if your server supports Big5 characters.
Re: Wrong position of colour embedding - HuSs3n - 20.10.2011
i tried
Code:
SendClientMessageToAll(0xFFFF00FF,"test : {FFFFFF}A quick brown fox jumps over the lazy dog.");
/
and got
whats wrong ? o_O
Re: Wrong position of colour embedding -
JernejL - 20.10.2011
it's not a ordinary space character, he uses long space from big5 charset.
Re: Wrong position of colour embedding -
leong124 - 21.10.2011
Yes. You probably can't see the bug on ANSI-coded servers.