]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/navigation.qc
Bot AI: immediately remove player as goal if dead and visible
[xonotic/xonotic-data.pk3dir.git] / 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