Bot_ExistsInServer: ddecolorize names before comparing.

This commit is contained in:
Marco Cawthorne 2024-03-09 19:22:26 -08:00
parent ffa3645395
commit 48b76b8786
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 5 additions and 1 deletions

View File

@ -17,9 +17,13 @@
bool
Bot_ExistsInServer(string botName)
{
string noColor1 = strdecolorize(botName);
for (entity e = world;(e = find(e, ::classname, "player"));) {
if (clienttype(e) == CLIENTTYPE_BOT) {
if (e.netname == botName) {
string noColor2 = strdecolorize(e.netname);
if (noColor1 == noColor2) {
return (true);
}
}