]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix bots attacking the wrong base in reverse mode
authorMario <mario.mario@y7mail.com>
Tue, 13 Aug 2013 05:35:41 +0000 (15:35 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 13 Aug 2013 05:35:41 +0000 (15:35 +1000)
qcsrc/server/mutators/gamemode_ctf.qc

index 167de84dce42b999a6d6945405ccb8263d1bd8ef..a915b2def97efc0cb7e777c3f301801559a3277b 100644 (file)
@@ -1128,7 +1128,7 @@ entity havocbot_ctf_find_flag(entity bot)
        f = ctf_worldflaglist;
        while (f)
        {
-               if (bot.team == f.team)
+               if (!ctf_IsDifferentTeam(bot, f))
                        return f;
                f = f.ctf_worldflagnext;
        }
@@ -1141,7 +1141,7 @@ entity havocbot_ctf_find_enemy_flag(entity bot)
        f = ctf_worldflaglist;
        while (f)
        {
-               if (bot.team != f.team)
+               if (ctf_IsDifferentTeam(bot, f))
                        return f;
                f = f.ctf_worldflagnext;
        }
@@ -1174,7 +1174,7 @@ void havocbot_goalrating_ctf_ourflag(float ratingscale)
        head = ctf_worldflaglist;
        while (head)
        {
-               if (self.team == head.team)
+               if (!ctf_IsDifferentTeam(self, head))
                        break;
                head = head.ctf_worldflagnext;
        }
@@ -1188,7 +1188,7 @@ void havocbot_goalrating_ctf_ourbase(float ratingscale)
        head = ctf_worldflaglist;
        while (head)
        {
-               if (self.team == head.team)
+               if (!ctf_IsDifferentTeam(self, head))
                        break;
                head = head.ctf_worldflagnext;
        }
@@ -1204,7 +1204,7 @@ void havocbot_goalrating_ctf_enemyflag(float ratingscale)
        head = ctf_worldflaglist;
        while (head)
        {
-               if (self.team != head.team)
+               if (ctf_IsDifferentTeam(self, head))
                        break;
                head = head.ctf_worldflagnext;
        }