From a67b4a1f1fae02f506b396f0b07d7a85f15dfc51 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 11 Dec 2017 15:50:22 +0100 Subject: [PATCH] Remove unused return value from bot_aimdir --- qcsrc/server/bot/default/aim.qc | 12 ++++++------ qcsrc/server/bot/default/aim.qh | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) 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) diff --git a/qcsrc/server/bot/default/aim.qh b/qcsrc/server/bot/default/aim.qh index e7c60758a..b8b35f1c2 100644 --- a/qcsrc/server/bot/default/aim.qh +++ b/qcsrc/server/bot/default/aim.qh @@ -90,7 +90,7 @@ void lag_update(entity this); void bot_lagfunc(entity this, float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4); float bot_shouldattack(entity this, entity targ); -float bot_aimdir(entity this, vector v, float maxfiredeviation); +void bot_aimdir(entity this, vector v, float maxfiredeviation); bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, bool applygravity); float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, float shotspeed, float shotspeedupward, float maxtime, float shotdelay, entity ignore); -- 2.39.2