From 2f8f114052ed09f07044e4e5b00725140f071cd9 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 2 Jul 2018 22:29:00 +0200 Subject: [PATCH] Bot AI: fix wrong checks causing incorrect bot role assignments --- qcsrc/common/gamemodes/gamemode/ctf/ctf.qc | 4 ++-- qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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; -- 2.39.2