]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
improve bot waypoint auditing
authorRudolf Polzer <divverent@xonotic.org>
Sun, 7 Aug 2011 14:31:17 +0000 (16:31 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 7 Aug 2011 14:31:17 +0000 (16:31 +0200)
qcsrc/server/bot/waypoints.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/t_teleporters.qc

index b39e59f762343fe4d15e2aa7ed5fc7519e41f82a..3bfb53264f19c241fbc562e21ba9ba6a09cfe463 100644 (file)
@@ -776,7 +776,10 @@ void waypoint_spawnforteleporter(entity e, vector destination, float timetaken)
 {
        local entity w;
        local entity dw;
-       w = waypoint_spawn(e.absmin, e.absmax, WAYPOINTFLAG_GENERATED | WAYPOINTFLAG_TELEPORT | WAYPOINTFLAG_NORELINK);
+       vector org;
+       org = (e.absmin + e.absmax) * 0.5;
+       org = waypoint_fixorigin(org);
+       w = waypoint_spawn(org, org, WAYPOINTFLAG_GENERATED | WAYPOINTFLAG_TELEPORT | WAYPOINTFLAG_NORELINK);
        dw = waypoint_spawn(destination, destination, WAYPOINTFLAG_GENERATED);
        // one way link to the destination
        w.wp00 = dw;
index 3dfd2a6aa7d1449d6950da633e59f170f3f0db8d..3ae62bc56962cc0b16ae435508f2837c061c1f78 100644 (file)
@@ -260,7 +260,7 @@ void ImpulseCommands (void)
                                        for(e = findchain(classname, "waypoint"); e; e = e.chain)
                                        {
                                                e.colormod_x = 1;
-                                               e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE;
+                                               e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE | EF_BRIGHTLIGHT;
                                        }
                                        e2 = navigation_findnearestwaypoint(self, FALSE);
                                        navigation_markroutes(e2);
@@ -272,7 +272,7 @@ void ImpulseCommands (void)
                                                {
                                                        print("unreachable: ", etos(e), " ", vtos(e.origin), "\n");
                                                        e.colormod_x = 0.1;
-                                                       e.effects |= EF_NODEPTHTEST | EF_BLUE;
+                                                       e.effects |= EF_NODEPTHTEST | EF_BLUE | EF_BRIGHTLIGHT;
                                                        ++i;
                                                        ++m;
                                                }
@@ -289,7 +289,7 @@ void ImpulseCommands (void)
                                                        e.colormod_x = 0.1;
                                                        if not(e.effects & EF_NODEPTHTEST) // not already reported before
                                                                ++m;
-                                                       e.effects |= EF_NODEPTHTEST | EF_RED;
+                                                       e.effects |= EF_NODEPTHTEST | EF_RED | EF_BRIGHTLIGHT;
                                                        ++i;
                                                }
                                        }
@@ -306,14 +306,14 @@ void ImpulseCommands (void)
                                                if(navigation_findnearestwaypoint(e, FALSE))
                                                {
                                                        setorigin(e, org);
-                                                       e.effects &~= EF_NODEPTHTEST;
+                                                       e.effects &~= EF_NODEPTHTEST | EF_BRIGHTLIGHT;
                                                        e.model = "";
                                                }
                                                else
                                                {
                                                        setorigin(e, org);
                                                        print("spawn without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
-                                                       e.effects |= EF_NODEPTHTEST;
+                                                       e.effects |= EF_NODEPTHTEST | EF_BRIGHTLIGHT;
                                                        setmodel(e, self.model);
                                                        e.frame = self.frame;
                                                        e.skin = self.skin;
@@ -323,6 +323,43 @@ void ImpulseCommands (void)
                                        }
                                        if(i)
                                                print(ftos(i), " spawnpoints have no nearest waypoint (marked by player model)\n");
+                                       i = 0;
+                                       entity start;
+                                       start = findchainflags(flags, FL_ITEM);
+                                       for(e = start; e; e = e.chain)
+                                       {
+                                               e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE | EF_BRIGHTLIGHT;
+                                       }
+                                       for(e = start; e; e = e.chain)
+                                       {
+                                               if(navigation_findnearestwaypoint(e, FALSE))
+                                               {
+                                               }
+                                               else
+                                               {
+                                                       print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
+                                                       e.effects |= EF_NODEPTHTEST | EF_RED | EF_BRIGHTLIGHT;
+                                                       ++i;
+                                               }
+                                       }
+                                       if(i)
+                                               print(ftos(i), " items have no nearest waypoint and cannot be walked away from (marked with red light)\n");
+                                       i = 0;
+                                       for(e = start; e; e = e.chain)
+                                       {
+                                               org = e.origin;
+                                               if(navigation_findnearestwaypoint(e, TRUE))
+                                               {
+                                               }
+                                               else
+                                               {
+                                                       print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
+                                                       e.effects |= EF_NODEPTHTEST | EF_BLUE | EF_BRIGHTLIGHT;
+                                                       ++i;
+                                               }
+                                       }
+                                       if(i)
+                                               print(ftos(i), " items have no nearest waypoint and cannot be walked to (marked with blue light)\n");
                                        break;
                        }
                }
index 4d7bd92cf86b3bbd4abf9daadc16537df796d5fe..003fcbc05f711f75330dbac6c5eaf293a45cfbe1 100644 (file)
@@ -256,13 +256,12 @@ void teleport_findtarget (void)
        for(e = world; (e = find(e, targetname, self.target)); )
        {
                ++n;
+               waypoint_spawnforteleporter(self, e.origin, 0);
                if(e.movetype == MOVETYPE_NONE)
                        RandomSelection_Add(e, 0, string_null, 1, 1);
                if(e.classname != "info_teleport_destination")
                        print("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n");
        }
-       if(RandomSelection_chosen_ent)
-               waypoint_spawnforteleporter(self, RandomSelection_chosen_ent.origin, 0);
 
        if(n == 0)
        {