X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fbot.qc;h=b45f35aa8fffb0d80b2e1b700f6636f7153e25ef;hp=b2e20e776435478bf7454d3eadef79ce5e989e5f;hb=e14bb786305e05541496fb5b28c090e0ff1b5783;hpb=e7c63b4a159ba5bed1a4e35d1df9ca19cdef95a2 diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index b2e20e776..b45f35aa8 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -148,7 +148,7 @@ void bot_setnameandstuff() prio = 1; FOR_EACH_CLIENT(p) { - if(clienttype(p) == CLIENTTYPE_BOT) + if(IS_BOT_CLIENT(p)) if(s == p.cleanname) { prio = 0; @@ -218,7 +218,7 @@ void bot_setnameandstuff() i = 0; FOR_EACH_CLIENT(p) { - if(clienttype(p) == CLIENTTYPE_BOT) + if(IS_BOT_CLIENT(p)) if(p.cleanname == name) ++i; } @@ -342,7 +342,7 @@ void bot_relinkplayerlist() { player_count = player_count + 1; e.nextplayer = e.chain; - if (clienttype(e) == CLIENTTYPE_BOT) + if (IS_BOT_CLIENT(e)) { if (prevbot) prevbot.nextbot = e; @@ -363,7 +363,7 @@ void bot_relinkplayerlist() void bot_clientdisconnect() { - if (clienttype(self) != CLIENTTYPE_BOT) + if not(IS_BOT_CLIENT(self)) return; bot_clearqueue(self); if(self.cleanname) @@ -386,7 +386,7 @@ void bot_clientdisconnect() void bot_clientconnect() { - if (clienttype(self) != CLIENTTYPE_BOT) + if not(IS_BOT_CLIENT(self)) return; self.bot_preferredcolors = self.clientcolors; self.bot_nextthink = time - random(); @@ -398,13 +398,13 @@ void bot_clientconnect() bot_setnameandstuff(); if(self.bot_forced_team==1) - self.team = FL_TEAM_1; + self.team = NUM_TEAM_1; else if(self.bot_forced_team==2) - self.team = FL_TEAM_2; + self.team = NUM_TEAM_2; else if(self.bot_forced_team==3) - self.team = FL_TEAM_3; + self.team = NUM_TEAM_3; else if(self.bot_forced_team==4) - self.team = FL_TEAM_4; + self.team = NUM_TEAM_4; else JoinBestTeam(self, FALSE, TRUE); @@ -425,13 +425,13 @@ void bot_removefromlargestteam() bestcount = 0; while (head) { - if(head.team == FL_TEAM_1) + if(head.team == NUM_TEAM_1) thiscount = c1; - else if(head.team == FL_TEAM_2) + else if(head.team == NUM_TEAM_2) thiscount = c2; - else if(head.team == FL_TEAM_3) + else if(head.team == NUM_TEAM_3) thiscount = c3; - else if(head.team == FL_TEAM_4) + else if(head.team == NUM_TEAM_4) thiscount = c4; else thiscount = 0; @@ -491,7 +491,7 @@ void autoskill(float factor) bestplayer = -1; FOR_EACH_PLAYER(head) { - if(clienttype(head) == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(head)) bestplayer = max(bestplayer, head.totalfrags - head.totalfrags_lastcheck); else bestbot = max(bestbot, head.totalfrags - head.totalfrags_lastcheck); @@ -551,7 +551,7 @@ float bot_fixcount() FOR_EACH_REALCLIENT(head) { - if(head.classname == "player" || g_lms || g_arena || g_ca) + if(IS_PLAYER(head) || g_lms || g_arena || head.caplayer == 1) ++activerealplayers; ++realplayers; }