X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fdefault%2Fhavocbot%2Fhavocbot.qc;h=3d4e298d13fe6196ab4784a297f677a62795faf3;hb=438689d3feb91ed0fe07b32a15d0ad9e83c774ae;hp=606857611490466116175de4c81f3bb210637438;hpb=df7cc0f9e47327aa077613f6fd16f63f62b2c255;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 606857611..3d4e298d1 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -674,7 +674,39 @@ void havocbot_movetogoal(entity this) if (this.goalcurrent == NULL) return; - navigation_poptouchedgoals(this); + + bool locked_goal = false; + if(this.goalentity && wasfreed(this.goalentity)) + { + navigation_clearroute(this); + this.bot_strategytime = 0; + return; + } + else if(this.goalentity.bot_pickup) + { + if(this.goalentity.bot_pickup_respawning) + { + if(this.goalentity.solid) // item respawned + 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; + } + 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(!locked_goal) + navigation_poptouchedgoals(this); // if ran out of goals try to use an alternative goal or get a new strategy asap if(this.goalcurrent == NULL)