]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: immediately remove player as goal if dead and visible
authorterencehill <piuntn@gmail.com>
Thu, 14 Sep 2017 14:45:32 +0000 (16:45 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 14 Sep 2017 14:45:32 +0000 (16:45 +0200)
qcsrc/server/bot/default/navigation.qc

index 9bdcf8dba8e549e7ad451fb63a1c343eb4bbb6f4..b21670a06357527f6a44d9ccb4d0bdd62695ec89 100644 (file)
@@ -1333,6 +1333,13 @@ bool navigation_routetogoal(entity this, entity e, vector startposition)
 int navigation_poptouchedgoals(entity this)
 {
        int removed_goals = 0;
+
+       if(IS_PLAYER(this.goalcurrent) && IS_DEAD(this.goalcurrent) && checkpvs(this.origin + this.view_ofs, this.goalcurrent))
+       {
+               navigation_poproute(this);
+               ++removed_goals;
+       }
+
        if(this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
        {
                // make sure jumppad is really hit, don't rely on distance based checks