From: terencehill Date: Thu, 22 Nov 2018 17:26:41 +0000 (+0100) Subject: Small optimization X-Git-Tag: xonotic-v0.8.5~1705^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=beab89e657ed03f3efe620fb546cf9f47af2a800;p=xonotic%2Fxonotic-data.pk3dir.git Small optimization --- diff --git a/qcsrc/server/bot/default/aim.qc b/qcsrc/server/bot/default/aim.qc index ae133b4ed..83de201bc 100644 --- a/qcsrc/server/bot/default/aim.qc +++ b/qcsrc/server/bot/default/aim.qc @@ -351,20 +351,12 @@ bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeed { float r, hf, distanceratio; vector v; - /* - eprint(this); - dprint("bot_aim(", ftos(shotspeed)); - dprint(", ", ftos(shotspeedupward)); - dprint(", ", ftos(maxshottime)); - dprint(", ", ftos(applygravity)); - dprint(");\n"); - */ - hf = this.dphitcontentsmask; this.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE; - shotspeed *= W_WeaponSpeedFactor(this); - shotspeedupward *= W_WeaponSpeedFactor(this); + float speed_factor = W_WeaponSpeedFactor(this); + shotspeed *= speed_factor; + shotspeedupward *= speed_factor; if (!shotspeed) { LOG_TRACE("bot_aim: WARNING: weapon ", this.(weaponentity).m_weapon.m_name, " shotspeed is zero!");