]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Disable a dead function in bot CTF code and fix bots trying to capture at bases that...
authorMario <mario@smbclan.net>
Sat, 4 Mar 2017 14:29:42 +0000 (00:29 +1000)
committerMario <mario@smbclan.net>
Sat, 4 Mar 2017 14:29:42 +0000 (00:29 +1000)
qcsrc/server/mutators/mutator/gamemode_ctf.qc

index afee84d297c806b54bf72cef0b7de79b567a4b74..b3270577de5408342cb2892eeea5766c3b6ca4fb 100644 (file)
@@ -1451,6 +1451,8 @@ int havocbot_ctf_teamcount(entity bot, vector org, float tc_radius)
        return c;
 }
 
+// unused
+#if 0
 void havocbot_goalrating_ctf_ourflag(entity this, float ratingscale)
 {
        entity head;
@@ -1464,6 +1466,7 @@ void havocbot_goalrating_ctf_ourflag(entity this, float ratingscale)
        if (head)
                navigation_routerating(this, head, ratingscale, 10000);
 }
+#endif
 
 void havocbot_goalrating_ctf_ourbase(entity this, float ratingscale)
 {
@@ -1472,7 +1475,15 @@ void havocbot_goalrating_ctf_ourbase(entity this, float ratingscale)
        while (head)
        {
                if (CTF_SAMETEAM(this, head))
+               {
+                       if (this.flagcarried)
+                       if ((this.flagcarried.cnt || head.cnt) && this.flagcarried.cnt != head.cnt)
+                       {
+                               head = head.ctf_worldflagnext; // skip base if it has a different group
+                               continue;
+                       }
                        break;
+               }
                head = head.ctf_worldflagnext;
        }
        if (!head)