]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/bot.qc
Merge branch 'master' into terencehill/bot_AI_improvements
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / bot.qc
index b52efbbd5c0eff353cc290e1edb5cd6f70136019..318422153bb3423478e9f8dc980a0fea24daf5e4 100644 (file)
@@ -46,6 +46,7 @@ entity bot_spawn()
        entity bot = spawnclient();
        if (bot)
        {
        entity bot = spawnclient();
        if (bot)
        {
+               setItemGroupCount();
                currentbots = currentbots + 1;
                bot_setnameandstuff(bot);
                ClientConnect(bot);
                currentbots = currentbots + 1;
                bot_setnameandstuff(bot);
                ClientConnect(bot);
@@ -63,9 +64,8 @@ void bot_think(entity this)
        if(autocvar_bot_god)
                this.flags |= FL_GODMODE;
 
        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;
 
        //if (this.bot_painintensity > 0)
        //      this.bot_painintensity = this.bot_painintensity - (skill + 1) * 40 * frametime;