]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: fix wrong checks causing incorrect bot role assignments
authorterencehill <piuntn@gmail.com>
Mon, 2 Jul 2018 20:29:00 +0000 (22:29 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 2 Jul 2018 20:29:00 +0000 (22:29 +0200)
qcsrc/common/gamemodes/gamemode/ctf/ctf.qc
qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc

index b500796fe5040cd8de43418981835a5e3c7866c5..855b043375c55568d6d92d4ec5da15bd98841a82 100644 (file)
@@ -1626,7 +1626,7 @@ void havocbot_ctf_reset_role(entity this)
                havocbot_role_ctf_setrole(this, HAVOCBOT_CTF_ROLE_OFFENSE);
                return;
        }
-       else if (CS(this).jointime < time + 1)
+       else if (time < CS(this).jointime + 1)
        {
                // if bots spawn all at once set good default roles
                if (count == 1)
@@ -1659,7 +1659,7 @@ void havocbot_ctf_reset_role(entity this)
                havocbot_role_ctf_setrole(this, HAVOCBOT_CTF_ROLE_MIDDLE);
 
        // if bots spawn all at once assign them a more appropriated role after a while
-       if (CS(this).jointime < time + 1 && count > 2)
+       if (time < CS(this).jointime + 1 && count > 2)
                this.havocbot_role_timeout = time + 10 + random() * 10;
 }
 
index d2ea25e17c7b774418d8fc65c499a02550f68d84..4d9175574b80ec79db6207523fb5fb7cc75ec5a4 100644 (file)
@@ -553,7 +553,7 @@ MUTATOR_HOOKFUNCTION(ft, HavocBot_ChooseRole)
        }
 
        // if bots spawn all at once assign them a more appropriated role after a while
-       if (CS(bot).jointime < time + 1)
+       if (time < CS(bot).jointime + 1)
                bot.havocbot_role_timeout = time + 10 + random() * 10;
 
        return true;