From: terencehill Date: Thu, 2 Nov 2017 16:56:31 +0000 (+0100) Subject: Bot AI: fix bots sometimes going back and forth between a waypoint and a frozen teamm... X-Git-Tag: xonotic-v0.8.5~2378^2~32 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7d9d2113;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: fix bots sometimes going back and forth between a waypoint and a frozen teammate instead of sticking to him to revive him --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index c512b8eb4..cd21f7aa8 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -1412,6 +1412,17 @@ int navigation_poptouchedgoals(entity this) if(vlen2(this.goalcurrent.origin - this.goalstack01.origin) > vlen2(this.goalstack01.origin - this.origin)) if(checkpvs(this.origin + this.view_ofs, this.goalstack01)) { + // this can happen when a player stands still or is frozen + // NOTE: this is only needed because tracewalk always fail when destination + // point is on a player and bot_navigation_ignoreplayers is false + if (this.goalentity.navigation_dynamicgoal + && boxesoverlap(this.absmin, this.absmax, this.goalentity.absmin, this.goalentity.absmax)) + { + navigation_poproute(this); + ++removed_goals; + return removed_goals; + } + vector dest = '0 0 0'; float dest_height = 0; SET_TRACEWALK_DESTCOORDS(this.goalstack01, this.origin, dest, dest_height);