From f9a2903759f520c9fca1a7ca9109860c68b6878d Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 6 Feb 2017 14:16:51 +0100 Subject: [PATCH] Fix drunk-like behaviour of certain bots when skill is set to a high value by reducing AI think interval depending on bot skill --- qcsrc/server/bot/default/bot.qc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index 2fb0a43c2..16a082b9f 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -64,9 +64,8 @@ void bot_think(entity this) if(autocvar_bot_god) this.flags |= FL_GODMODE; - this.bot_nextthink = this.bot_nextthink + autocvar_bot_ai_thinkinterval * pow(0.5, this.bot_aiskill); - if(this.bot_nextthink < time) - this.bot_nextthink = time + autocvar_bot_ai_thinkinterval * pow(0.5, this.bot_aiskill); + this.bot_nextthink = max(time, this.bot_nextthink) + max(0.01, autocvar_bot_ai_thinkinterval * pow(0.5, this.bot_aiskill) * min(14 / (skill + 14), 1)); + //if (this.bot_painintensity > 0) // this.bot_painintensity = this.bot_painintensity - (skill + 1) * 40 * frametime; -- 2.39.2