From: terencehill Date: Tue, 25 Dec 2018 18:49:40 +0000 (+0100) Subject: Bot AI: allow turning in a more natural way when a low skilled bot is walking X-Git-Tag: xonotic-v0.8.5~1586^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5065ca5641d767ada3e1c4a98a6860c941a85345;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: allow turning in a more natural way when a low skilled bot is walking --- diff --git a/qcsrc/server/bot/default/aim.qc b/qcsrc/server/bot/default/aim.qc index 633fdf243..c69442f19 100644 --- a/qcsrc/server/bot/default/aim.qc +++ b/qcsrc/server/bot/default/aim.qc @@ -206,6 +206,11 @@ void bot_aimdir(entity this, vector v, float maxfiredeviation) // invalid aim dir (can happen when bot overlaps target) if(!v) return; + float skill_save = skill; + // allow turning in a more natural way when bot is walking + if (!this.bot_aimtarg) + skill = max(4, skill); + // get the desired angles to aim at //dprint(" at:", vtos(v)); v = normalize(v); @@ -326,6 +331,8 @@ void bot_aimdir(entity this, vector v, float maxfiredeviation) //if (diffang_y >= 180) // diffang_y = diffang_y - 360; + skill = skill_save; + //dprint("e ", vtos(diffang), " < ", ftos(maxfiredeviation), "\n"); // decide whether to fire this time @@ -340,8 +347,6 @@ void bot_aimdir(entity this, vector v, float maxfiredeviation) } //dprint(ftos(maxfiredeviation),"\n"); //dprint(" diff:", vtos(diffang), "\n"); - - //return this.bot_canfire && (time < this.bot_firetimer); } vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, float shotdelay)