]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix drunk-like behaviour of certain bots when skill is set to a high value by reducin...
authorterencehill <piuntn@gmail.com>
Mon, 6 Feb 2017 13:16:51 +0000 (14:16 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 6 Feb 2017 13:16:51 +0000 (14:16 +0100)
qcsrc/server/bot/default/bot.qc

index 2fb0a43c2b150cc9d726336a7ed095996b865902..16a082b9f708d4defb87d62b7b8e4e0495c2c5d1 100644 (file)
@@ -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;