]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mand1nga/bot-fixes-II
authormand1nga <mand1nga@xonotic.org>
Thu, 18 Aug 2011 22:22:08 +0000 (19:22 -0300)
committermand1nga <mand1nga@xonotic.org>
Thu, 18 Aug 2011 22:22:08 +0000 (19:22 -0300)
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/bot/navigation.qc

index 113d318506b456d478aa3b7ab62701ba0347cb05..2505888ef01b421c56c5aa82a2c06e20de8fc080 100644 (file)
@@ -260,15 +260,12 @@ void havocbot_bunnyhop(vector dir)
        if(autocvar_g_midair)
                return;
 
-       // Don't jump when using some weapons
-       /*
+       // Don't jump when attacking
        if(self.aistatus & AI_STATUS_ATTACKING)
-       if(self.weapon == WEP_RIFLE)
                return;
 
        if(self.goalcurrent.classname == "player")
                return;
-       */
 
        maxspeed = autocvar_sv_maxspeed;
 
@@ -789,12 +786,11 @@ void havocbot_movetogoal()
                                                if(tracebox_hits_trigger_hurt(dst_ahead, self.mins, self.maxs, trace_endpos))
                                                {
                                                        // Remove dangerous dynamic goals from stack
-                                                       if (self.goalcurrent.classname == "player" || self.goalcurrent.classname == "droppedweapon")
-                                                       {
-                                                               navigation_poproute();
-                                                               if(self.goalcurrent)
-                                                                       gco = (self.goalcurrent.absmin + self.goalcurrent.absmax) * 0.5;
-                                                       }
+                                                       dprint("bot ", self.netname, " removed the goal ", self.goalcurrent.classname, " ", etos(self.goalcurrent), " because it leads to a dangerous path\n");
+                                                       navigation_poproute();
+                                                       if(self.goalcurrent)
+                                                               gco = (self.goalcurrent.absmin + self.goalcurrent.absmax) * 0.5;
+
                                                        // try to stop
                                                        flatdir = '0 0 0';
                                                        evadeobstacle = normalize(self.velocity) * -1;
index 4cf685ddb42f970afa43a58c88206333a99fcb76..93a683a9341cba58301801faabc56598b05187f2 100644 (file)
@@ -199,6 +199,10 @@ void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradi
                                        continue;
                        }
 
+                       // TODO: rate waypoints near the targetted player at that moment, instead of the player itself
+                       //               adding a player as a goal seems to be quite dangerous, especially on space maps
+                       //               remove hack in navigation_poptouchedgoals() after performing this change
+
                        t = (self.health + self.armorvalue ) / (head.health + head.armorvalue );
                        navigation_routerating(head, t * ratingscale, 2000);
                }
index 968e760b8b721caff6b71cd452af93dd183fe726..de4019d995f73143100cab8dcfa1b3ed55dbcb5c 100644 (file)
@@ -907,6 +907,10 @@ void navigation_poptouchedgoals()
                // personality property
        }
 
+       // HACK: remove players/bots as goals, they can lead a bot to unexpected places (cliffs, lava, etc)
+       // TODO: rate waypoints near the targetted player at that moment, instead of the player itself
+       if(self.goalcurrent.classname=="player")
+               navigation_poproute();
 
        // Loose goal touching check when running
        if(self.aistatus & AI_STATUS_RUNNING)