]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix speed checks. The broken loose goal touching check when running was occasionally...
authorterencehill <piuntn@gmail.com>
Mon, 30 Jan 2017 16:53:35 +0000 (17:53 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 30 Jan 2017 16:53:35 +0000 (17:53 +0100)
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/navigation.qc

index e2ff5e79905022fabb51e28001ca2af306af2627..a35d312db1b209b23428b9b04c5ee0dcaa8933a1 100644 (file)
@@ -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;
index fd8a521d1de2c8dd7a084e2f98351b863e5029f8..742213a8977c897633c5868864dd31e89f95a423 100644 (file)
@@ -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))
                {