From: terencehill Date: Sun, 25 Dec 2016 09:41:36 +0000 (+0100) Subject: Bot logic: improve jumppad touch detection (e.g. on Xoylent occasionally bots skipped... X-Git-Tag: xonotic-v0.8.2~343^2~15 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ff28f51fe8b708fbce4554fa240eb100b377229a;p=xonotic%2Fxonotic-data.pk3dir.git Bot logic: improve jumppad touch detection (e.g. on Xoylent occasionally bots skipped the jumppad and tried to leap into the void) --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 70391d56b..0e4243de6 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -878,6 +878,8 @@ void navigation_poptouchedgoals(entity this) if(this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT) { + // make sure jumppad is really hit, don't rely on distance based checks + // as they may report a touch even if it didn't really happen if(this.lastteleporttime>0) if(time - this.lastteleporttime < ((this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL) ? 2 : 0.15)) { @@ -913,14 +915,11 @@ void navigation_poptouchedgoals(entity this) if(IS_PLAYER(this.goalcurrent)) navigation_poproute(this); - // aid for detecting jump pads better (distance based check fails sometimes) - if(this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT && this.jumppadcount > 0 ) - navigation_poproute(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(vdist(this.origin - this.goalcurrent.origin, <, 150)) { @@ -942,6 +941,9 @@ void navigation_poptouchedgoals(entity this) while (this.goalcurrent && boxesoverlap(m1, m2, this.goalcurrent.absmin, this.goalcurrent.absmax)) { + if((this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)) + break; + // Detect personal waypoints if(this.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING) if(this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL && this.goalcurrent.owner==this)