]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Hack: do not use players as goals
authormand1nga <mand1nga@xonotic.org>
Thu, 18 Aug 2011 21:20:08 +0000 (18:20 -0300)
committermand1nga <mand1nga@xonotic.org>
Thu, 18 Aug 2011 21:20:08 +0000 (18:20 -0300)
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/bot/navigation.qc

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)