From: terencehill Date: Sat, 23 Sep 2017 16:59:02 +0000 (+0200) Subject: Remove a redundant check, cleanup some jetpack code X-Git-Tag: xonotic-v0.8.5~2378^2~53 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=053f1039485e7e75fc84937784fd49b16453d9c8;p=xonotic%2Fxonotic-data.pk3dir.git Remove a redundant check, cleanup some jetpack code --- diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 3a44f0e8b..56da186b8 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -470,7 +470,6 @@ void havocbot_movetogoal(entity this) PHYS_INPUT_BUTTON_JETPACK(this) = false; // Jetpack navigation - if(this.goalcurrent) if(this.navigation_jetpack_goal) if(this.goalcurrent==this.navigation_jetpack_goal) if(this.ammo_fuel) @@ -497,14 +496,10 @@ void havocbot_movetogoal(entity this) if(this.aistatus & AI_STATUS_JETPACK_LANDING) { // Calculate brake distance in xy - float db, v, d; - vector dxy; - - dxy = this.origin - ( ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5 ); dxy.z = 0; - d = vlen(dxy); - v = vlen(this.velocity - this.velocity.z * '0 0 1'); - db = ((v ** 2) / (autocvar_g_jetpack_acceleration_side * 2)) + 100; - // dprint("distance ", ftos(ceil(d)), " velocity ", ftos(ceil(v)), " brake at ", ftos(ceil(db)), "\n"); + float d = vlen(vec2(this.origin - (this.goalcurrent.absmin + this.goalcurrent.absmax) * 0.5)); + float v = vlen(vec2(this.velocity)); + float db = ((v ** 2) / (autocvar_g_jetpack_acceleration_side * 2)) + 100; + //LOG_INFOF("distance %d, velocity %d, brake at %d ", ceil(d), ceil(v), ceil(db)); if(d < db || d < 500) { // Brake