The status thing was wrong (iirc) even with the old colors (if you are talking about misaligned strings).
- Code: Select all
char c2 = c - (c & 128);
http://www.asciitable.com/ - look below to see extended ASCII table
All chars with value greater than or equal to 128 get 128 subtracted. That said if you have ▓ (178) it is changed to the value of 178-128=50, that is number 2 (check at ASCII table).
c & 128 is
bitwise and (&&). It works like this:
abcdefgh - c in binary
10000000 - 128 in binary
Now it does boolean AND between appropiate bit from c and bit from 128.
Example:
10010110 - 150
10000000 - 128
150 & 128 = 1&1 0&0 0&0 1&0 0&0 1&0 1&0 0&0 = 1 0 0 0 0 0 0 0 = 10000000 = 128 in decimal
- Code: Select all
if (d[j] == STRING_COLOR_TAG)
{
*cur++ = STRING_COLOR_TAG;
*cur++ = STRING_COLOR_TAG;
}
Yes, ++ has precedence over *, so pointer is incremented, than dereferenced and changed into whatever STRING_COLOR_TAG is. From the name I guess it used to dump colored player names in linux console, but this is just a wild guess.
- Code: Select all
It seems that name1 is padded with ^7 only when a ^[0-9] but not ^7
is used in name1. Now we have to append ^7 always after a name!
Not necessarily. The name is parsed correctly if you have ^[0,9] anywhere in your name.
Example:
name ^x834wow^2^x482miau
name ^1blah
works correctly. That means you need to parse the name every time and not only when it has ^[0,9] what I suppose current code does. Finding that place would probably fix it.
Sorry, I can't help more because I don't know what div said to you what is wrong.