From: terencehill Date: Mon, 2 Jul 2018 20:29:00 +0000 (+0200) Subject: Bot AI: fix wrong checks causing incorrect bot role assignments X-Git-Tag: xonotic-v0.8.5~1923^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2f8f114052ed09f07044e4e5b00725140f071cd9;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: fix wrong checks causing incorrect bot role assignments --- diff --git a/qcsrc/common/gamemodes/gamemode/ctf/ctf.qc b/qcsrc/common/gamemodes/gamemode/ctf/ctf.qc index b500796fe..855b04337 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/ctf.qc +++ b/qcsrc/common/gamemodes/gamemode/ctf/ctf.qc @@ -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; } diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc index d2ea25e17..4d9175574 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc @@ -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;