X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fdefault%2Faim.qc;h=7441ce7bcab56cfafd3cf9e1ac8b6b68eab9385d;hb=a67b4a1f1fae02f506b396f0b07d7a85f15dfc51;hp=94bbd752b4a936d94f387a5958b06d8d89c3abde;hpb=37c2247d6909278c925cf78ea91e7adb5df91b45;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/bot/default/aim.qc b/qcsrc/server/bot/default/aim.qc index 94bbd752b..7441ce7bc 100644 --- a/qcsrc/server/bot/default/aim.qc +++ b/qcsrc/server/bot/default/aim.qc @@ -174,7 +174,7 @@ void bot_lagfunc(entity this, float t, float f1, float f2, entity e1, vector v1, this.bot_canfire = 1; } -float bot_aimdir(entity this, vector v, float maxfiredeviation) +void bot_aimdir(entity this, vector v, float maxfiredeviation) { float dist, delta_t, blend; vector desiredang, diffang; @@ -185,7 +185,7 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation) this.v_angle_z = 0; // invalid aim dir (can happen when bot overlaps target) - if(!v) return false; + if(!v) return; // get the desired angles to aim at //dprint(" at:", vtos(v)); @@ -317,7 +317,7 @@ float 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); + //return this.bot_canfire && (time < this.bot_firetimer); } vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, float shotdelay) @@ -328,7 +328,7 @@ vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, flo bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, bool applygravity) { - float f, r, hf, distanceratio; + float r, hf, distanceratio; vector v; /* eprint(this); @@ -370,11 +370,11 @@ bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeed return false; } - f = bot_aimdir(this, findtrajectory_velocity - shotspeedupward * '0 0 1', r); + bot_aimdir(this, findtrajectory_velocity - shotspeedupward * '0 0 1', r); } else { - f = bot_aimdir(this, v - shotorg, r); + bot_aimdir(this, v - shotorg, r); //dprint("AIM: ");dprint(vtos(this.bot_aimtargorigin));dprint(" + ");dprint(vtos(this.bot_aimtargvelocity));dprint(" * ");dprint(ftos(this.bot_aimlatency + vlen(this.bot_aimtargorigin - shotorg) / shotspeed));dprint(" = ");dprint(vtos(v));dprint(" : aimdir = ");dprint(vtos(normalize(v - shotorg)));dprint(" : ");dprint(vtos(shotdir));dprint("\n"); //traceline(shotorg, shotorg + shotdir * 10000, false, this); //if (trace_ent.takedamage)