]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/bot.qc
set classname of assault waypoint sprites to "sprite_waypoint" (instead of having...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / bot.qc
index 44ece52bfd9c66cd2caf0d67af3ce2c4c0256d4e..3ef50481dc5eb785e6cf2d60a0d26c47078b9436 100644 (file)
@@ -136,7 +136,8 @@ void bot_setnameandstuff()
                        prio = 1;
                        FOR_EACH_CLIENT(p)
                        {
-                               if(strcat(prefix, s, suffix) == p.netname)
+                               if(clienttype(p) == CLIENTTYPE_BOT)
+                               if(s == p.cleanname)
                                {
                                        prio = 0;
                                        break;
@@ -200,8 +201,6 @@ void bot_setnameandstuff()
        else
                name = bot_name;
 
-       self.cleanname = strzone(name);
-
        // number bots with identical names
        float i;
        i = 0;
@@ -212,7 +211,11 @@ void bot_setnameandstuff()
                                ++i;
        }
        if (i)
-               name = strcat(name, "(", ftos(i), ")");
+               self.netname = self.netname_freeme = strzone(strcat(prefix, name, "(", ftos(i), ")", suffix));
+       else
+               self.netname = self.netname_freeme = strzone(strcat(prefix, name, suffix));
+
+       self.cleanname = strzone(name);
 
        // pick the model and skin
        if(substring(bot_model, -4, 1) != ".")
@@ -220,8 +223,6 @@ void bot_setnameandstuff()
        self.playermodel = self.playermodel_freeme = strzone(strcat("models/player/", bot_model));
        self.playerskin = self.playerskin_freeme = strzone(bot_skin);
 
-       self.netname = self.netname_freeme = strzone(strcat(prefix, name, suffix));
-
        self.cvar_cl_accuracy_data_share = 1;  // share the bots weapon accuracy data with the world
        self.cvar_cl_accuracy_data_receive = 0;  // don't receive any weapon accuracy data
 };
@@ -544,7 +545,7 @@ void bot_serverframe()
 
        FOR_EACH_REALCLIENT(head)
        {
-               if(head.classname == "player" || g_lms || g_arena)
+               if(head.classname == "player" || g_lms || g_arena || g_ca)
                        ++activerealplayers;
                ++realplayers;
        }