]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: if the current goal is taken by someone keep going to the goal until it's...
authorterencehill <piuntn@gmail.com>
Thu, 7 Sep 2017 17:31:28 +0000 (19:31 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 7 Sep 2017 17:31:28 +0000 (19:31 +0200)
qcsrc/server/bot/default/havocbot/havocbot.qc

index 439ef5471525c4486e99221fc8d6fb9921e27410..4891b8d3852b9c35f270236c52e6a15095fcb1b5 100644 (file)
@@ -734,19 +734,25 @@ void havocbot_movetogoal(entity this)
                                this.goalentity.bot_pickup_respawning = false;
                        else if(time < this.goalentity.scheduledrespawntime - 10) // item already taken (by someone else)
                        {
-                               this.goalentity.bot_pickup_respawning = false;
-                               navigation_clearroute(this);
-                               this.bot_strategytime = 0;
-                               return;
+                               if(checkpvs(this.origin, this.goalentity))
+                               {
+                                       this.goalentity.bot_pickup_respawning = false;
+                                       navigation_clearroute(this);
+                                       this.bot_strategytime = 0;
+                                       return;
+                               }
                        }
                        else if(this.goalentity == this.goalcurrent)
                                locked_goal = true; // wait for item to respawn
                }
                else if(!this.goalentity.solid)
                {
-                       navigation_clearroute(this);
-                       this.bot_strategytime = 0;
-                       return;
+                       if(checkpvs(this.origin, this.goalentity))
+                       {
+                               navigation_clearroute(this);
+                               this.bot_strategytime = 0;
+                               return;
+                       }
                }
        }
        if(!locked_goal)