fix a small error in the function to delete tags of a string,

...was buggy when starting with numbers.

This fix a tiny bug : player name starting with a digit, had this
digit repeated twice in the satus table

But i will use more this function in my next commit, so it must be
cleaner.  The function itself is very ugly and has a clone in
utils.cpp. I will clean this mess after the release.
This commit is contained in:
Ali El Gariani 2007-07-19 21:58:57 +00:00
parent a8a2f20add
commit 2287ca72f4

View File

@ -124,7 +124,7 @@ std::string del_tags(std::string name){
std::string::const_iterator it;
for (it = name.begin(); it != name.end(); it++){
// Start of RGB definition block, so stop react on numbers
if (not_name && *it == COLOR_TEXT){
if (not_name && *it == '<'){
not_colour = false;
}
// Ending of RGB block
@ -135,7 +135,6 @@ std::string del_tags(std::string name){
// Number outside colour block
if (not_name && not_colour && isdigit(*it)){
not_name = false;
str << *it;
}
// On the first analphabet character we stop react on specials characters