Better Xonotic name colour filtering

This commit is contained in:
DeathByDenim 2023-05-07 12:52:36 -04:00
parent e4f91b4b5a
commit 1602749c73
Signed by: DeathByDenim
GPG Key ID: 4A475283D925365B
1 changed files with 6 additions and 4 deletions

View File

@ -32,10 +32,12 @@ async function xonoticGetScores() {
if(fields[5] === "spectator") {
break;
}
let split_fields = fields[3].split(",");
let player_name = fields[6]
.replace(/\^.../g, "")
.replaceAll("^7", "");
const split_fields = fields[3].split(",");
// Filter out the custom colours in names
const player_name = fields[6]
.replace(/\^x.../g, "")
.replace(/\^\d/g, "");
let player_stats = {name: player_name};
for(let i = 0; i < labels.length; i++) {
if(labels[i] != "") {