mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-16 02:15:19 +00:00
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:
parent
a8a2f20add
commit
2287ca72f4
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user