]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make sure teleport/jumppad waypoints aren't improperly popped from the goal queue
authorterencehill <piuntn@gmail.com>
Mon, 31 Jul 2017 20:32:42 +0000 (22:32 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 31 Jul 2017 20:33:23 +0000 (22:33 +0200)
qcsrc/server/bot/default/navigation.qc

index 073943f4eb2cfdb5bcf0b41b6fa57ecefe5a2d38..453b0930c336d973bdf9b73ec477d7c24a7e739a 100644 (file)
@@ -1337,6 +1337,8 @@ void navigation_poptouchedgoals(entity this)
                {
                        LOG_DEBUG("path optimized for ", this.netname, ", removed a goal from the queue");
                        navigation_poproute(this);
+                       if(this.goalcurrent && this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
+                               return;
                        // TODO this may also be a nice idea to do "early" (e.g. by
                        // manipulating the vlen() comparisons) to shorten paths in
                        // general - this would make bots walk more "on rails" than
@@ -1365,6 +1367,8 @@ void navigation_poptouchedgoals(entity this)
                                }
 
                                navigation_poproute(this);
+                               if(this.goalcurrent && this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
+                                       return;
                        }
                }
        }
@@ -1390,6 +1394,8 @@ void navigation_poptouchedgoals(entity this)
                }
 
                navigation_poproute(this);
+               if(this.goalcurrent && this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
+                       return;
        }
 }