Decompile fn_13883 (StripColorTokens)

Batch #13855 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_13883 StripColorTokens: logic confirmed by peer review

Peer-reviewed-by: Yommy, KWDev, StrawberrysherbetIX
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-07 02:52:14 +00:00
commit 878c46a2ca

View file

@ -45,17 +45,19 @@ bool IsHexColorToken(const char* text, const char* end) {
std::string __stdcall StripColorTokens(const char* text, std::uint32_t length) {
std::string result;
result.reserve(length);
if (text != nullptr) {
const char* current = text;
const char* end = text + length;
while (current < end) {
if (IsHexColorToken(current, end)) {
current += 7;
} else if (IsPipeColorToken(current)) {
current += 3;
} else {
result.push_back(*current++);
}
if (text == nullptr) {
return result;
}
const char* current = text;
const char* end = text + length;
while (current < end) {
if (IsHexColorToken(current, end)) {
current += 7;
} else if (IsPipeColorToken(current)) {
current += 3;
} else {
result.push_back(*current++);
}
}