1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-03 10:14:06 +02:00

minor color code stripping improvements

This commit is contained in:
Robin Appelman 2021-07-29 19:34:37 +02:00
commit 13771825ec

View file

@ -227,8 +227,8 @@ pub struct SayText2Message {
impl SayText2Message {
pub fn plain_text(&self) -> String {
// 1: normal, 2: team, 3: team, 4: location
let mut text = self.text.replace(|c| c <= char::from(4), "");
// 1: normal, 2: old colors, 3: team, 4: location, 5 achievement, 6 custom
let mut text = self.text.replace(|c| c <= char::from(6), "");
// 7: 6-char hex
while let Some(pos) = text.chars().enumerate().find_map(|(index, c)| {
if c == char::from(7) {