From: terencehill Date: Mon, 30 Jan 2017 16:53:35 +0000 (+0100) Subject: Fix speed checks. The broken loose goal touching check when running was occasionally... X-Git-Tag: xonotic-v0.8.2~202^2~21 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=647689c44b363d03ef50a7467d14c6d4e4c2cadc;p=xonotic%2Fxonotic-data.pk3dir.git Fix speed checks. The broken loose goal touching check when running was occasionally causing bots carrying the enemy flag to get stuck right in front of their own base --- diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index e2ff5e799..a35d312db 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -316,7 +316,7 @@ void havocbot_bunnyhop(entity this, vector dir) // Run only to visible goals if(IS_ONGROUND(this)) - if(this.speed==maxspeed) + if(vlen(this.velocity - eZ * this.velocity.z) >= autocvar_sv_maxspeed) // if -really- running if(checkpvs(this.origin + this.view_ofs, this.goalcurrent)) { this.bot_lastseengoal = this.goalcurrent; diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index fd8a521d1..742213a89 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -960,9 +960,9 @@ void navigation_poptouchedgoals(entity this) // Loose goal touching check when running if(this.aistatus & AI_STATUS_RUNNING) - if(this.speed >= autocvar_sv_maxspeed) // if -really- running if(this.goalcurrent.classname=="waypoint") if(!(this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)) + if(vlen(this.velocity - eZ * this.velocity.z) >= autocvar_sv_maxspeed) // if -really- running { if(vdist(this.origin - this.goalcurrent.origin, <, 150)) {